Limitations
With the new RAID shelf I wanted to test adding disks to logical or virtual drives and growing the filesystem. The major limitation is the continuous disk space.
Setting up the RAID shelf
In my test setup I had a 1143384MB RAID 5 group to which I added another 300MB disk. The RAID box it is smart enough to redistribute the information across all the drives so it took 10:03:50 to complete the add. The final size came out to 1429230MB but the space was now in three partitions.
| Partition | Offset (MB) | Size (MB) |
| 0 | 0 | 571692 |
| 1 | 571692 | 571692 |
| 2 | 11432384 | 285846 |
Removing the third partion yields.
| Partition | Offset (MB) | Size (MB) |
| 0 | 0 | 571692 |
| 1 | 571692 | 857538 |
Of course the warnings that you are deleting all data were ignored but I could not add disk space to the first partition without removing the second partition which is unfortunate and the expected limitation. I did not want to remove the second partition to redistribute the new space evenly since I did not have a backup of the partitions.
On the computer, fdisk and other ugliness
I had to reboot the computer since the SCSI card did not dynamically recognize the larger disk space. The following steps may be slightly inprecise since I rebooted into single user mode.
# fdisk -u /dev/da4
******* Working on device /dev/da4 *******
parameters extracted from in-core disklabel are:
cylinders=109320 heads=255 sectors/track=63 (16065 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=109320 heads=255 sectors/track=63 (16065 blks/cyl)
Do you want to change our idea of what BIOS thinks ? [n]
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 1170817137 (571688 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 1023/ head 254/ sector 63
Do you want to change it? [n] y
Supply a decimal value for "sysid (165=FreeBSD)" [165]
Supply a decimal value for "start" [63]
Supply a decimal value for "size" [1170817137] 1756237823
Warning partition does not end on a cylinder boundry
Correct this automatically [n] y
Warning adjusting size of partition to 176225737
fdisk: Geom not found
#
Once the primary partition on the disk is larger the next step is to change the filesystem partition size.
# bsdlabel -e /dev/da4s1
# /dev/da4s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 1170817137 0 unused 0 0 # "raw" part, don't edit
d: 1170817137 0 4.2BSD 2048 16384 28552
This I didn't understand, the
documentation I was using told me that the label size would automatically change for the "raw" part. I was not concerned about messing up the OS so I proceeded to change both entries and save my changes.
# /dev/da4s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 1756225737 0 unused 0 0 # "raw" part, don't edit
d: 1756225737 0 4.2BSD 2048 16384 28552
It seemed to work correctly so I proceded in running
growfs.
# growfs -s 1756225737 /dev/da4s1d
Running
fsck,
mount and then
df seemed to give me the correct results.
# df /dev/da3s1d /dev/da4s1d
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/da3s1d 566991318 100 521631914 0% /u3
/dev/da4s1d 850406342 100 782373736 0% /u4
# df -h /dev/da3s1d /dev/da4s1d
Filesystem Size Used Avail Capacity Mounted on
/dev/da3s1d 541G 100K 497G 0% /u3
/dev/da4s1d 811G 100K 746G 0% /u4
#
--
RayWhite - 31 Mar 2006