Note: This web page was automatically created from a PalmOS "pedit32" memo.

Changing a sun from multiple partitions on a disk to just one


Initial partitioning: partition> print Current partition table (original): Total disk cylinders available: 14087 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 104 - 544 2.14GB (441/0/0) 4487616 1 var wm 545 - 559 74.53MB (15/0/0) 152640 2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312 3 swap wu 0 - 103 516.75MB (104/0/0) 1058304 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 560 - 566 34.78MB (7/0/0) 71232 6 unassigned wm 0 0 (0/0/0) 0 7 home wm 567 - 14086 65.60GB (13520/0/0) 137579520
From memory, for first partition - merging /var into /: mkdir /newvar copy /var to /newvar comment out /var on /etc/vfstab umount /var rmdir /var mv /newvar /var reboot In sun format: Note the end cylinder of the /var partition delete /var partition (EG, just make it start at cyl 0 and 0 cyls long, so it's clear it isn't used for anything) Redefine the / partition to end at the same end cylinder /var used to have, using, in this case, 559e (e is a "unit" for the end cylinder of a partition)
After the reboot, I get: partition> print Current partition table (original): Total disk cylinders available: 14087 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 104 - 559 2.21GB (456/0/0) 4640256 1 unassigned wm 0 0 (0/0/0) 0 2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312 3 swap wu 0 - 103 516.75MB (104/0/0) 1058304 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 560 - 566 34.78MB (7/0/0) 71232 6 unassigned wm 0 0 (0/0/0) 0 7 home wm 567 - 14086 65.60GB (13520/0/0) 137579520
If you can get all the processes using a filesystem to go away, the reboots are unnecessary - just umount
If swap is in between two partitions you want to merge, you'll probably want to configure away swap in /etc/vfstab, reboot, merge swap, merge some more if needed, then carve off some space for swap at the end. But, in my case, swap was actually at the beginning of the disk - yours might be too
As needed: growfs -M / /dev/rdsk/c1t0d0s0 Be prepared for it to take a long time. Just a guess, but it's probably preallocating a bunch of inodes to preserve the previous inode to data block ratio. Be sure to use the raw device (rdsk), not the cooked device (dsk). You may have to change /'s mount options (in /etc/vfstab, or possibly via mount -o remount) to not have logging, with the "nologging" option, instead of "-" or whatever.
My growfs final didn't complete, even though I left it running overnight. The manual page says to speed up the process by running a bunch of growfs's with the -s option :(
In some or all cases, you will need to boot from external media (CD, NFS, perhaps another disk) in order to do the final grow, because in some cases at least, the root filesystem cannot be grown while it is mounted


Back to Dan's palm memos