Index | Musings on computing |
In this page, I'll describe my experience using Solaris 9 growfs. First a little bit of background. At about the time that Solaris 10 came out (end of January 2005), I had a pair of 9G SCSI disks croak on me, so I replaced them with a couple of 73G disks. In a way, this was good news, as I knew that I didn't have enough space on my Solaris 9 installation for a full upgrade to Solaris 10. After the upgrade I had loads of space (much of which is still unused).
My PC is multiboot. I mainly use Solaris, but I also have OS/2, FreeBSD, Windows 2000 and Linux installed. And DOS, almost forgot it! DOS and FreeBSD are on a really old 2G SCSI disk. Linux is on a 4.3G SCSI disk of its own. That leaves the two main SCSI disks with all the rest.
I've tried to split each OS over both disks. Here is a summary of the layout before I used growfs:
and
The first thing that I did was backup everything. If you want to try this sort of thing without making backups, then you're either crazy, or your time and data have no value.
For disk1, I used PartitionMagic to move the extended partition that followed the Solaris partition (at the same time I grew the NTFS partition). This left a 3G 'hole' after /usr. For disk2, things were a bit more complicated. PartitionMagic no longer handles HPFS (even though that was probably the primary purpose that it was originally written for!). I do have older versions of PartitionMagic that will handle HPFS, but they don't seem to be able to cope with 73G SCSI disks. So exit PartitionMagic. My solution was as follows.
Now to make the Solaris partitions bigger. Normally I use FreeBSD for this, as it has a fairly friendly fdisk (unlike Solaris fdisk, the less said about which the better!). For disk1, I ran 'fdisk -t -u', noted the LBA numbers for the Solaris partition and the partition that followed it. I then calculated what I needed to add to the LBA length in order for the Solaris partition to 'fill the hole', and I let fdisk work out the CHS values for me.
For some reason, FreeBSD fdisk didn't want to let me do the same thing for disk2. So I booted my PartitionMagic CD once again, this time to run ptedit and edit the LBA and CHS values myself.
Finally, I was ready to grow the UFS partitions. I kept a log of what I did, and here it is. I'll intersperse it with comments in italics. Obviously, if you want to do this on your own system, then the numbers will almost certainly be different.
# ksh -o emacs
# which growfs
/usr/sbin/growfs
# format
Searching for disks...done
c1t5d0: configured with capacity of 1.87GB
c1t8d0: configured with capacity of 4.20GB
AVAILABLE DISK SELECTIONS:
0. c1t1d0 <DEFAULT cyl 1604 alt 2 hd 10 sec 258>
/pci@0,0/pci1de1,3907@a/sd@1,0
1. c1t2d0 <DEFAULT cyl 2625 alt 2 hd 10 sec 258>
/pci@0,0/pci1de1,3907@a/sd@2,0
2. c1t5d0 <IBMOEM-0664M1H-661 cyl 2787 alt 2 hd 15 sec 94>
/pci@0,0/pci1de1,3907@a/sd@5,0
3. c1t8d0 <IBM-DDRS-34560W-S98G cyl 8084 alt 2 hd 5 sec 218>
/pci@0,0/pci1de1,3907@a/sd@8,0
Type 0 to select disk 0
Specify disk (enter its number): 0
selecting c1t1d0
[disk formatted]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
type 'partition'
format> partition
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
type 'print' to see the details of the partition
partition> print
Current partition table (original):
Total disk cylinders available: 4107 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wm 0 - 1603 1.97GB (1604/0/0) 4138320
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 1 - 1603 1.97GB (1603/0/0) 4135740
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type '2' to edit partition 2
partition> 2
Part Tag Flag Cylinders Size Blocks
2 backup wm 0 - 1603 1.97GB (1604/0/0) 4138320
Enter partition id tag[backup]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
type in new partition size, '4107c'
Enter partition size[4138320b, 1604c, 1603e, 2020.66mb, 1.97gb]: 4107c
type 'print' to see the details of the modified partition
partition> print
Current partition table (unnamed):
Total disk cylinders available: 4107 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wm 0 - 4106 5.05GB (4107/0/0) 10596060
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 1 - 1603 1.97GB (1603/0/0) 4135740
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type '6' to edit /usr
partition> 6
Part Tag Flag Cylinders Size Blocks
6 usr wm 1 - 1603 1.97GB (1603/0/0) 4135740
Enter partition id tag[usr]:
Enter partition permission flags[wm]:
Enter new starting cyl[1]:
type in new partition size, '4106c'
Enter partition size[4135740b, 1603c, 1603e, 2019.40mb, 1.97gb]: 4106c
type 'print' to see the details of the modified partition
partition> print
Current partition table (unnamed):
Total disk cylinders available: 4107 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wm 0 - 4106 5.05GB (4107/0/0) 10596060
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 1 - 4106 5.05GB (4106/0/0) 10593480
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type 'quit' to leave the partition edit menu
partition> quit
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
try to save the changes
format> save
Please name this partition type before saving it
UH OH, back to disk 0 partiton menu - I'll skip all of the details
partition> label
Ready to label disk, continue? y
partition> quit
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> quit
I then double checked that my edit had been saved, which I'll skip as well. Next to grow the partition.
# growfs
usage: growfs [ -M mount-point ] [ newfs-options ] raw-special-device
# growfs /dev/rdsk/c1t1d0s6
/dev/rdsk/c1t1d0s6: 10593480 sectors in 4106 cylinders of 10 tracks, 258 tors
5172.6MB in 257 cyl groups (16 c/g, 20.16MB/g, 9664 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 41584, 83136, 124688, 166240, 207792, 249344, 290896, 332448, 374000,
10198096, 10239648, 10281200, 10322752, 10364304, 10405856, 10447408,
10488960, 10530512, 10567712,
That was easy. Next up, / (root)
# format
Searching for disks...done
c1t5d0: configured with capacity of 1.87GB
c1t8d0: configured with capacity of 4.20GB
AVAILABLE DISK SELECTIONS:
0. c1t1d0 <DEFAULT cyl 4107 alt 2 hd 10 sec 258>
/pci@0,0/pci1de1,3907@a/sd@1,0
1. c1t2d0 <DEFAULT cyl 2625 alt 2 hd 10 sec 258>
/pci@0,0/pci1de1,3907@a/sd@2,0
2. c1t5d0 <IBMOEM-0664M1H-661 cyl 2787 alt 2 hd 15 sec 94>
/pci@0,0/pci1de1,3907@a/sd@5,0
3. c1t8d0 <IBM-DDRS-34560W-S98G cyl 8084 alt 2 hd 5 sec 218>
/pci@0,0/pci1de1,3907@a/sd@8,0
Type 1 to select disk 1
Specify disk (enter its number): 1
selecting c1t2d0
[disk formatted]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
type 'partition'
format> partition
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
type 'print' to see the details of the partition
partition> print
Current partition table (original):
Total disk cylinders available: 18983 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 2523 3.10GB (2523/0/0) 6509340
1 swap wu 2524 - 2625 128.50MB (102/0/0) 263160
2 backup wm 0 - 2625 3.23GB (2626/0/0) 6775080
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type '2' to edit partition 2
partition> 2
Part Tag Flag Cylinders Size Blocks
2 backup wm 0 - 2625 3.23GB (2626/0/0) 6775080
Enter partition id tag[backup]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
type in new partition size, '18983c'
Enter partition size[6775080b, 2626c, 2625e, 3308.14mb, 3.23gb]: 18983c
type 'print' to see the details of the modified partition
partition> print
Current partition table (unnamed):
Total disk cylinders available: 18983 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 2523 3.10GB (2523/0/0) 6509340
1 swap wu 2524 - 2625 128.50MB (102/0/0) 263160
2 backup wm 0 - 18982 23.35GB (18983/0/0) 48976140
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type '6' to edit swap - note that for this, I don't want to increase the size, I just want to change the start
partition> 1
Part Tag Flag Cylinders Size Blocks
1 swap wu 2524 - 2625 128.50MB (102/0/0) 263160
Enter partition id tag[swap]:
Enter partition permission flags[wu]:
type new starting cyl '18881'
Enter new starting cyl[2524]: 18881
Enter partition size[263160b, 102c, 18982e, 128.50mb, 0.13gb]:
type 'print' to see the details of the modified partition
partition> print
Current partition table (unnamed):
Total disk cylinders available: 18983 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 2523 3.10GB (2523/0/0) 6509340
1 swap wu 18881 - 18982 128.50MB (102/0/0) 263160
2 backup wm 0 - 18982 23.35GB (18983/0/0) 48976140
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
type '0' to edit / (root)
partition> 0
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 2523 3.10GB (2523/0/0) 6509340
Enter partition id tag[root]:
Enter partition permission flags[wm]:
Enter new starting cyl[1]:
type in new partition size, '18880c'
Enter partition size[6509340b, 2523c, 2523e, 3178.39mb, 3.10gb]: 18880c
type 'print' to see the details of the modified partition
partition> print
Current partition table (unnamed):
Total disk cylinders available: 18983 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 18880 23.23GB (18880/0/0) 48710400
1 swap wu 18881 - 18982 128.50MB (102/0/0) 263160
2 backup wm 0 - 18982 23.35GB (18983/0/0) 48976140
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 0 (0/0/0) 0
9 unassigned wm 0 0 (0/0/0) 0
don't foget to save the label this time
partition> label
Ready to label disk, continue? y
partition> quit
snip
format> quit
# growfs /dev/rdsk/c1t2d0s0
/dev/rdsk/c1t2d0s0: 48710400 sectors in 18880 cylinders of 10 tracks, 258ctors
23784.4MB in 525 cyl groups (36 c/g, 45.35MB/g, 5696 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 93184, 186336, 279488, 372640, 465792, 558944, 652096, 745248, 838400,
Initializing cylinder groups:
..........
super-block backups for last 10 cylinder groups at:
47834048, 47927200, 48020352, 48113504, 48206656, 48299808, 48392960,
48486112, 48579264, 48672416,
And that's it. After that I booted the Solaris 10 installation CD and did an upgrade.
One last comment. In my case, it was easy for me to grow my partitions because the partitions that I wanted to grow had nothing of any importance following them. (/usr was followed by nothing, and / (root) was followed by swap, which I didn't care about). If this hadn't been the case (say I had /usr followed by /var) then the situation would have been far more complex. I would have had to have done something like
Backing up and restoring might be tricky if you don't have a tape drive, spare disk or network to backup to.
Copyright © Paul John Floyd 2005 - 2006