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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris changing slice partion sizes? 1

Status
Not open for further replies.

DBDIR

MIS
Sep 5, 2003
33
GB
Hi, I am running Solaris 7 (oh dear!) but the basics should be same I hope to those of you using 8 or 9..
I wish to change the partition sizes of my slices: They are as follows:

/proc 0 0 0 0% /proc
/dev/dsk/c0t0d0s0 1984230 99324 1825380 6% /
/dev/dsk/c0t0d0s6 3007086 1398813 1548132 48% /usr
fd 0 0 0 0% /dev/fd
/dev/dsk/c0t0d0s4 247471 75590 147134 34% /var
/dev/dsk/c0t0d0s7 10076116 8175554 1799801 82% /backup
/dev/dsk/c0t0d0s3 3007086 9 2946936 1% /export/home
/dev/dsk/c0t0d0s5 962134 410403 494003 46% /opt
swap 448120 2296 445824 1% /tmp


I wish to take space from the /backup slice & add to the /usr slice.

I would rather not use the ufsdump route - is there a way to do this dynamically inthe same way that tools tlike partition magic works on Wintel boxes... ?

Thanks in advance.
 
The short answer is "no".

You might have been able to increase the size of /usr dynamically if there was room on the disk after that slice, but that seems unlikely.

There is no way to reduce the size of a UFS filesystem dynamically, so you would always end up having to do a ufsdump and ufsrestore or similar to reduce the size of that filesystem.

Annihilannic.
 
Thanks for the info. If I choose to add a 2nd harddrive to the system & ufsdump the data across. What command do I run on the old disk? If I change the partition size then whn I do a ufsrestore will it restore ok? i.e If the size of the slice is larger than the slice backup will it add to the new slice and leave the extra space?
Sorry confused

Thanks
 
Can you post the output of prtvtoc /dev/rdsk/c0t0d0s2 please?

You won't be able to use space from the /backup filesystem to increase the size of /usr unless it is immediately after /usr on the disk. Since /usr is on slice 6 and /backup is on slice 7 it looks promising, but that doesn't necessarily mean the slices are in that order on the disk. The prtvtoc output will confirm that.

Whatever you do, step 1 is to make sure you have a backup!

The procedure would be something like:

[ul][li]ufsdump 0f /somewhere/on/second/disk/backup.ufs /backup[/li]
[li]umount /backup
[li]Go into format and adjust the partition sizes accordingly (change the end of slice 6 and beginning of slice 7). Take note of the new size of slice 6 in blocks (rightmost column)[/li]
[li]Use /usr/lib/mkfs -M /usr /dev/rdsk/c0t0d0s6 size to resize the filesystem. size is the size in blocks recorded in the previous step.[/li]
[li]newfs /dev/rdsk/c0t0d0s7 to create a new filesystem for /backup[/li]
[li]mount /backup[/li]
[li]cd /backup ; ufsrestore xf /somewhere/on/second/disk/backup.ufs[/li][/ul]

Annihilannic.
 
Actually, on review, don't use the number of blocks displayed by format as the size... it doesn't seem to use the same units as I expected. I'll figure out a better way to find that out.

Annihilannic.
 
Thanks.

No DLT at the moment so I will have to use a spare drive.... how do you mount a new drive & run two at the same time?? - The system is up ad the file systems mounted at the moment - I have a new IDE drive waiting to be added... Thanks again

 
No, I was right the first time, the figure from format is the correct value to use.

Unfortuantely I have no experience of using IDE drives with Solaris. Hopefully all you will need to do is touch /reconfigure, power off, connect it and reboot. You should then be able to see it in format and partition it.

Then you will need to create a new filesystem on it, using newfs /dev/rdsk/cNtNdNsN (see the man page). Make sure you get the correct disk ID for the new drive.

Then you can mount it manually on /mnt using mount -F ufs /dev/dsk/cNtNdNsN /mnt.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top