Copyright © 2010 Yonah Russ' Journal. All Rights Reserved. Snowblind by Themes by bavotasan.com. Powered by WordPress.
A friend of mine asked me the other day if there was such a thing as Partition Magic for Solaris. Apparently, someone had installed a system on a single slice and they’re security team was requiring a separate partition for the DB.
Here are the givens:
- Sunfire V210
- Solaris 8 (Otherwise we’d be using zfs)
- 2 73GB disks
- 1 slice on disk1
- Disk 2 is supposed to be a mirror of disk 1 but it isn’t used yet
- Downtime is allowed
- Reinstalling is not an option
I personally don’t know of any tool that lets you shrink UFS partitions but that doesn’t mean that we can’t perform some Partition Magic of our own.
NOTE: I have not tested this procedure. I think it is logical and should work and it should do no harm as the first disk remains fully intact.
- Go into single user mode
- Partition the second disk as required.
- newfs the partitions on the second disk
- Mount the second disk’s partitions
- Use ufsdump/ufsrestore to copy the filesystem into it’s smaller home
ufsdump 0f - / | ( cd /mnt/newroot ;ufsrestore xvf - ) - When all the partitions are done, use installboot to make the second disk bootable.
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t2d0s0 - Shutdown the system, physically swap the disks, and do a reconfiguration reboot.
If rebooting goes smoothly, test your new system thoroughly and then build your mirrors.










August 17, 2007 at 10:22 am
This works, thanks for the hint. I did a Google search on resize Solaris partitions and your page came up. Solaris defaults to woefully inadequate /var partition size and fortunately there was a second unused drive in the machine. I have done this on two servers and it works great.
August 3, 2008 at 12:18 am
Worked great for me, too.
For Solaris 10, be sure to substitute installboot command with installgrub:
installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s0