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!!! :-)

Comments:

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 14, 2009 at 09:00 PM 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 03: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 10:54 AM 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 11:38 AM EAT #

Vineeth Pillai rocks!!!

Posted by Alex on July 02, 2009 at 09:29 AM EAT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

vineeth

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today