How to grow Root Disk File Systems in Solaris

book

Article ID: 100021387

calendar_today

Updated On:

Description

Description

How to grow Encapsulated Root Disk File Systems (UFS) in Solaris.

 

Resolution

 
In this example we will use a system that has two 72GB drives, the same steps can be used with different sized disks.
 
I will increase root from 16Gb to 32Gb and /var from 3.9Gb to 8Gb:
 
Filesystem size used avail capacity Mounted on
/dev/vx/dsk/bootdg/rootvol 16G 5.5G 11G 35% /
/dev/vx/dsk/bootdg/var 3.9G 721M 3.1G 19% /var
 
The current boot disk is c0t1d0.
 
1.) Locate an available drive to use as the alternate root disk.
#format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@0,0
1. c0t1d0
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@1,0
 
2.) Repartition the drive with the desired sizes.
Old Root Disk Partition Table:
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm413 - 3834 16.60GB (3422/0/0) 34822272
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu0 - 14086 68.35GB (14087/0/0) 143349312
3 var wm3835 - 4640 3.91GB (806/0/0) 8201856
4 - wu 0 - 634.78MB (7/0/0) 71232
5 unassigned wm 0 0 (0/0/0) 0
6 - wu 7 -14086 68.32GB (14080/0/0) 143278080
7 home wm4641 - 14086 45.83GB (9446/0/0) 96122496
 
New root Disk Partition Table:
partition>p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm413 - 7007 32.00GB (6595/0/0) 67110720
1 swap wu 0- 412 2.00GB (413/0/0) 4202688
2 backup wu0 - 14086 68.35GB (14087/0/0) 143349312
3 var wm7008 - 8656 8.00GB (1649/0/0) 16780224
4 - wu 0 0(0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 - wu 0 0(0/0/0) 0
7 home wm8657 - 13996 25.91GB (5340/0/0) 54339840
 
3.) Create the new root disk environment.
 
# newfs/dev/rdsk/c0t0d0s0
newfs:/dev/rdsk/c0t0d0s0 last mounted as /tmp/rootdisk
newfs:construct a new file system /dev/rdsk/c0t0d0s0: (y/n)? y
Warning: 192sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s0:67110720 sectors in 10923 cylinders of 48 tracks, 128 sectors
32768.9MB in683 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464,196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
.............
super-block backups for last 10 cylinder groups at:
66162848,66261280, 66359712, 66458144, 66556576, 66655008, 66753440,
66851872,66950304, 67048736
 
# newfs /dev/dsk/c0t0d0s3
newfs:construct a new file system /dev/rdsk/c0t0d0s3: (y/n)? y
Warning:5184 sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s3:16780224 sectors in 2732 cylinders of 48 tracks, 128 sectors
8193.5MB in171 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464,196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
15831200,15929632, 16028064, 16126496, 16224928, 16323360, 16421792,
16520224,16618656, 16717088
 
# newfs /dev/rdsk/c0t0d0s7
newfs:construct a new file system /dev/rdsk/c0t0d0s7: (y/n)? y
Warning:3840 sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s7:54339840 sectors in 8845 cylinders of 48 tracks, 128 sectors
26533.1MB in553 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464,196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
..........
super-block backups for last 10 cylinder groups at:
53383072,53481504, 53579936, 53678368, 53776800, 53875232, 53973664,
54072096,54170528, 54268960
 
# mkdir /tmp/rootdisk
# mount /dev/dsk/c0t0d0s0 /tmp/rootdisk
# mkdir /tmp/rootdisk/var
# mkdir -p /tmp/rootdisk/export/home
# mount /dev/dsk/c0t0d0s3 /tmp/rootdisk/var
# mount /dev/dsk/c0t0d0s7 /tmp/rootdisk/export/home
 
4.) Copy the data from the old root disk to the new root disk using ufsdump.
 
# ufsdump 0f- / |(cd /tmp/rootdisk; ufsrestore xf -)
DUMP:8830330 blocks (4311.68MB) on 1 volume at 5694 KB/sec
DUMP: DUMPIS DONE
DUMP: Level0 dump on Tue Nov 25 11:35:59 2008
Add links
Set directory mode, owner, and times.
setowner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
 
# ufsdump 0f- /var |(cd /tmp/rootdisk/var; ufsrestore xf -)
DUMP:1498894 blocks (731.88MB) on 1 volume at 4844 KB/sec
DUMP: DUMP IS DONE
DUMP: Level0 dump on Tue Nov 25 11:36:27 2008
Add links
Set directory mode, owner, and times.
setowner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
 
# ufsdump 0f- /export/home |(cd /tmp/rootdisk/export/home; ufsrestore xf -)
DUMP:10494160 blocks (5124.10MB) on 1 volume at 7605 KB/sec
DUMP: DUMP IS DONE
DUMP: Level0 dump on Tue Nov 25 11:37:02 2008
Add links
Set directory mode, owner, and times.
setowner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
 
5.) Edit the vfstab to reflect the new boot disk.
 
Create a backup copy of the vfstab:
# cp /tmp/rootdisk/etc/vfstab /tmp/rootdisk/etc/vfstab-`date '+%H%M-%m-%d'`
 
Use the 'vfstab.prevm' as a template for the new boot disk:
# cp /tmp/rootdisk/etc/vfstab.prevm /tmp/rootdisk/etc/vfstab
Update the new vfstab with the alternate boot disk.
 
If your new boot disk is c0t0d0 make sure all of the entries in vfstab reflect this.
Example:
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no
 
6.) Edit the 'system' file on the new boot disk.
# vi /tmp/rootdisk/etc/system and remove the following two lines:
rootdev:/pseudo/vxio@0:0
setvxio:vol_rootdev_is_volume=1
 
7.) Install Solaris boot block.
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
 
8.) Reboot the host using the new root disk.
You now have a new root disk with larger slices for both root and var.
 
# df -h /var
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 32G 9.2G 22G 30% /
/dev/dsk/c0t0d0s3 7.9G 726M 7.1G 10% /var
Now we need to re-encapsulate the new root disk.
 
9.) Before encapsulating the new disk you will need to remove the old root disk volumes.
# vxedit -g rootdg -rf rm home rootvol var
Note: Depending on your configuration you may need to remove additional root disk volumes.
 
10.) Encapsulate the new root disk
# vxdiskadm
....
2. Encapsulate one or more disks
....
Select an operation to perform:2
Encapsulate one or more disks
Menu:Volume Manager/Disk/Encapsulate
Use this operation to convert one or more disks to use the Volume Manager.
This adds the disks to a disk group and replaces existing partitions
with volumes. Disk encapsulation requires a reboot for the changes
to take effect.
More than one disk or pattern may be entered at the prompt. Here are
some disk selection examples:
all: all disks
c3 c4t2: all disks on both controller 3 and controller 4, target 2
c3t4d2: a single disk (in the c#t#d# naming scheme)
xyz_0 : a single disk (in the enclosure based naming scheme)
xyz_ : all disks on the enclosure whose name is xyz
Select disk devices to encapsulate:
[,all,list,q,?]c0t0d0
Here is the disk selected. Output format: [Device_Name]
c0t0d0
Continue operation? [y,n,q,?] (default: y)
You can choose to add this disk to an existing disk group or to
a new disk group. To create a new disk group, select a disk group
name that does not yet exist.
Which disk group [,list,q,?] rootdg
Use a default disk name for the disk? [y,n,q,?] (default: y)
The selected disks will be encapsulated and added to the rootdg
disk group with default disk names.
c0t0d0
Continue with operation? [y,n,q,?] (default: y)
The following disk has been selected for encapsulation.
Output format: [Device_Name]
c0t0d0
Continue with encapsulation? [y,n,q,?] (default: y)
VxVM INFOV-5-2-333
The disk device c0t0d0 will be encapsulated and added to the disk group
rootdg with the disk name rootdg01.
Enter desired private region length
[,q,?](default: 65536)
The c0t0d0disk has been configured for encapsulation.
The first stage of encapsulation has completed successfully. You
should now reboot your system at the earliest possible opportunity.
The encapsulation will require two or three reboots which will happen
automatically after the next reboot. To reboot execute the command:
'shutdown -g0-y -i6'
This will update the /etc/vfstab file so that volume devices are
used to mount the file systems on this disk device. You will need
to update any other references such as backup scripts, databases,
or manually created swap devices.
Encapsulate other disks? [y,n,q,?] (default: n)
 
11.) Reboot the system
After the reboot the system should now have an encapsulated boot disk with increased space in both var and root.
 
# df -h /var
Filesystem size used avail capacity Mounted on
/dev/vx/dsk/bootdg/rootvol 32G 9.2G 22G 30% /
/dev/vx/dsk/bootdg/var 7.9G 727M 7.1G 10% /var

Issue/Introduction

How to grow Encapsulated Root Disk File Systems (UFS) in Solaris.