Transferring root image of opensolaris to another disk
After so long, I got something really interesting that made me start my blogs again! 
My Workstation runs opensolaris and this started as a pilot project to see whether opensolaris would serve me better than Solaris Express in my Work. So my initial installation of opensolaris had a small root partition of 20gb. It turned out that opensolaris was giving me whatever I wanted with a much better look and feel. My pilot project went live and I was permanently switching to opensolaris from SXCE. Now I got a problem, my root partition was running out of space
.
My manager came to my help and gave me a second hard disk with a greater storage
. Wow, Now I had space, but I didn't want to reinstall opensolaris on second disk. Yes, I wanted to transfer my root image to the second hard disk! My Unix common sense started working and I was lost in the world of format, fdisk, dd etc etc for some time. Wait a minute, did I hear ZFS??? Yes opensolaris has zfs boot, why should I worry? Its time to scrap years of obsolete concepts!
.
So what I did was quick and neat!
1)Created a 50gb partition in the second disk(c9d0s0)
2)#zfs attach rpool c8d0S0 c9d0S0
Zfs started its resilvering process soon and I had my mirror ready in 15 minutes. Now installing grub on second hard disk
3)#installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c9d0s0
I didn't wan't to take chance, so I rebooted with the mirror configuration for rpool. I changed Hard disk order in BIOS and happily booted into opensolaris. I didn't want my mirror configuration any more and I had plans with that extra space in first hard disk. So I did:
4)#zpool detach rpool c8d0S0
There it is, I have my Opensolaris root image transfered to the second hard disk and happily running!
This was pretty interesting for me to see all the stuff going on so smoothly which would have been a bit complicated, if it was not for zfs. Now I have my root image transferred to a bigger partition and I have a lot more space in root partition now!
ZFS, you rock!!! 
Posted at 08:53PM May 14, 2009 by vineeth in Sun | Comments[5]
Hi,
All the characters in this entries appeared as some kind of icons.
I needed to remove 'face="wingdings"' from all paragraphs.
Posted by Katsumi INOUE on May 15, 2009 at 04:00 AM EAT #
Sorry for that, I didn't realize the font changes.. I have reverted back to Arial now.
Posted by Vineeth Pillai on May 15, 2009 at 10:09 AM EAT #
Hi - quick question as I am confused!
If you added a 50Gb slice (eg c9d0s0) to the existing 20Gb slice (eg c8d0s0) in rpool - wouldn't only 20Gb be utilised from the 50Gb slice - so loosing 30Gb, but gaining a mirror of the data?
Or does zfs somehow support unequal mirroring across disks in rpool now - when slices are being used instead of whole disks?
Thanks
Simon
Posted by Simon Rowe on May 15, 2009 at 05:54 PM EAT #
While creating mirror, it gave a warning that mirror contains vdevs with un-equal space. But as my intention was to create an image in the second disk, I didn't take this warning seriously.
Ofcourse zfs would take only the smaller size for mirroring. But when I detached the smaller disk, smart zfs identified this and gave me the full 50GB for my new root filesystem :-)
Posted by Vineeth Pillai on May 15, 2009 at 06:38 PM EAT #
Vineeth Pillai rocks!!!
Posted by Alex on July 02, 2009 at 04:29 PM EAT #