Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to repartition/reformat? 1

Status
Not open for further replies.

cyan01

Programmer
Mar 13, 2002
143
0
0
US
I am learning Solaris Admin work. I recently installed Solaris 8 on a ultra sparc 5.

Now, I want to repartition/reformat /, /usr, /opt, etc. How do I do it without reinstall it? I have a bootable CD.

Here is what I am planning to do:

Code:
OK> boot cdrom -s
mount /dev/dsk/c0t0d0s0 /mnt
## I know I should then use 'ufsdump' command

I also realize that I must have missed lots of important steps. Could someone kindly show me how to do it step by step. Many thanks!
 
Here's some old Solaris restore procedures of mine. They assume you have your backup on one ufsdump tape and that you know the order and location of each partition.

Good luck!

Restoring

Special considerations must be made when restoring the root (/) file system on any Solaris system. The following steps illustrate how to do a complete filesystem restore from tape.

1. Insert the Solaris 2.X Software CD-ROM into the CD-ROM drive.
Note: On most systems any version of the Solaris Operating Environment will allow the system to boot up successfully, however, some newer systems require a Solaris 8 (SunOS 5.8) or Solaris 7 (SunOS 5.7) Operating environment.

2. Write-protect the tape and put it in the tape drive.

3. From the boot PROM (ok prompt), type in the following command.
boot cdrom -s
This will boot the system off of the CD-ROM and into single-user mode. This allows the interactive Solaris environment where you will be able to mount the internal and external hard drive and reload the data.

4. At the "#" prompt, enter the following:
format
Using this facility, modify, if necessary, the applicable partitions so they reflect format and vfstab documentation for the specific system.

5. Create the tape device entries.
tapes

6. Create a new file system for the partition that you are about to restore. The following steps will show how to restore the root (/) partition.
newfs /dev/rdsk/c0t3d0s0
Note: /dev/rdsk/c0t3d0s0 is an example. Refer to the specific system’s vfstab for the correct location of the root (/) partition.

7. Mount the new file system on a temporary mount point.
mount /dev/dsk/disk /mnt

8. Change to the /mnt directory.
cd /mnt

9. Use the ufsrestore command to restore the appropriate file system.
ufsrestore rvf /dev/rmt/0
Note: The previous command assumes you will want to rewind the tape drive after restoring the file system. If you do not want to rewind the tape drive (i.e. You are restoring the next file system on the tape drive) use the option /dev/rmt/0n instead of /dev/rmt/0.

10. Verify the file system is restored.
ls

11. Remove the restoresymtable file.
rm restoresymtable
This removes the restoresymtable file that is created and used by ufsrestore to check point the restore.

12. Change to the root (/) directory.
cd /

13. Unmount the newly restored file system.
umount /mnt

14. Check the new filesystem.
fsck /dev/rdsk/disk

15. Create the boot blocks on the root partition by using the installboot command. This step only needs to be done for the root partition.
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \ /dev/rdsk/disk
Note: The command in this step can be done in one line if the backslash (\) is removed or two lines with the backslash.

16. Repeat the steps 6 through 14 for the rest of the file systems.
Note: Be sure to ensure you are at the correct location on the backup tape by restoring the rest of the system in the same order you backed it up in and use the restore option (/dev/rmt/0 or /dev/rmt/0n) as appropriate.

17. Reboot the system
init 6

18. After ensuring that the restored system is working correctly, do a complete system backup to a new tape as shown earlier in this document.
 
I tried the previous steps , in setp 17 and after reboot I find the following errot and the system doesnot boot :
"cannot mount root on /pseudo/mde0:0,0,blk fstype UFS
Panicalcpu01/thread=10408000:vfs_mountroot: canot mount root."
.
.
.
.
skipping system dump - no dump device configured.

can any one help me.

Thanks alot.
 
Are you using metadevices? That makes things a little more tricky. If you aren't using concats or strips, it shouldn't be too difficult to setup again.

You'll have to boot to cdrom again in single user mode, mount up your root partition and edit your /etc/vfstab to reflect the new partition layout. You may have already done this.

Back up your /etc/system file to /etc/system.bak. You'll then have to edit your /etc/system file and take out the rootdev entry. Should look something like this:
rootdev:/pseudo/md@0:0,10,blk

Your system will probably complain that it lost some mirrors. I'd set them up again ASAP. Here's a handy website that'll tell you how to do it:
 
I'm new to Solaris. Do I have to set up the mirror prior to doing the restore? If my restore was done while the system was mirrored will it know that after I have done a complete restore?
 
then you have to disable SDS for all the filesystems
-> edit /etc/vfstab and replace all /dev/md/dsk/... and /dev/md/rdsk/... by the physical paths /dev/dsk/... and /dev/rdsk/...
edit /etc/system: there is a block looking like this
Code:
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_hotspares
forceload: misc/md_sp
forceload: misc/md_stripe
forceload: misc/md_mirror
forceload: drv/pcisch
forceload: drv/qlc
forceload: drv/fp
forceload: drv/ssd
rootdev:/pseudo/md@0:0,1,blk
* End MDD root info (do not edit)
comment at least the rootdev line...

rename /etc/init.d/svm.init and /etc/init.d/svm.sync to hide them

try a reboot

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Am trying to do a ufsrestore to another different server (V440 to E450).

I have restored root /, /usr and /opt thinking this few system file should be enough to boot me into single user mode. But when during boot -rs . Encounter an error

mount : /dev/dsk/c0t0d0s4 or /usr, no such file or directory.

I had boot cdrom -s and mount up /dev/dsk/c0t0d0s4 and checked that /usr is indeed there.

Any idea how to resolve the mounting problem during boot ?

Thanks for any valuable advice.
 
1) "ufsrestore to another different server (V440 to E450)"
I have never seen this working properly!

2) I suggest to run the restore, mv /a/etc/path_to_inst to another name and boot a "boot -av"

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top