Hallo, Howto rename zpool offline (with zdb)? I use OpenSolaris in a VM. Pool rpool is to small. So i create rpool2 and copy FS from rpool: domu # zfs send -R $srcpool@$srcsnap | zfs receive -vFd $dstpool status: domu # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT rpool 3,97G 3,00G 988M 75% ONLINE - rpool2 5,97G 3,00G 2,97G 50% ONLINE - dom0 # xm list $vm -l | egrep "vbd|:disk|zvol" (vbd (dev xvda:disk) (uname phy:/dev/zvol/dsk/rpool/zvol/domu-2-root) (vbd (dev xvdb:disk) (uname phy:/dev/zvol/dsk/rpool/zvol/domu-21-root) Pool rpool2 should be rename to rpool. But pool rpool is online, no rename is possible. Howto rename rpool2 to rpool (with zdb) offline? regards Heiko
On Mon, Dec 3, 2012 at 4:14 AM, Heiko L. <h.lehmann at hs-lausitz.de> wrote:> Hallo, > > Howto rename zpool offline (with zdb)?You don''t. You simply export the pool, and import it (zpool import). Something like # zpool import old_pool_name_or_ID new_pool_name> > I use OpenSolaris in a VM. > Pool rpool is to small. > So i create rpool2 and copy FS from rpool: > domu # zfs send -R $srcpool@$srcsnap | zfs receive -vFd $dstpoolThere''s more required then simply copying the data. See http://docs.oracle.com/cd/E23824_01/html/821-1448/recover-4.html If your VM is full virtualization (e.g. hvm), then the instructions should be the same. If it''s xen PV, then the hardest part might be finding the correct kernel boot parameter.> Pool rpool2 should be rename to rpool.Not really. Last time I tried with some version of opensolaris, you can use whatever pool name you want IF you create it manually (e.g. use a variant of the above instructions). Check grub command line, it should include the pool name to boot. However note that using a pool name other than rpool is AFAIK unsupported, so you might be best just follow the instructions above. In your case it should basically be boot with rescue CD and WITHOUT the old pool disks, then importing the new pool using a new name (rpool), then follow the relevant part or the docs. -- Fajar
You can''t change the name of a zpool without importing it. For what you''re attempting to do, why not attach a larger vdisk and mirror the existing disk in rpool? Then drop the smaller vdisk and you''ll have a larger rpool. Alternatively, take a look at "beadm" as it should have a means of creating a new BE on your rpool2, though I suspect you will have to install grub on it to make it bootable once you remove the old rpool. -Phil Sent from my iPad On Dec 2, 2012, at 3:14 PM, "Heiko L." <h.lehmann at hs-lausitz.de> wrote:> Hallo, > > Howto rename zpool offline (with zdb)? > > I use OpenSolaris in a VM. > Pool rpool is to small. > So i create rpool2 and copy FS from rpool: > domu # zfs send -R $srcpool@$srcsnap | zfs receive -vFd $dstpool > > status: > domu # zpool list > NAME SIZE USED AVAIL CAP HEALTH ALTROOT > rpool 3,97G 3,00G 988M 75% ONLINE - > rpool2 5,97G 3,00G 2,97G 50% ONLINE - > > > dom0 # xm list $vm -l | egrep "vbd|:disk|zvol" > (vbd > (dev xvda:disk) > (uname phy:/dev/zvol/dsk/rpool/zvol/domu-2-root) > (vbd > (dev xvdb:disk) > (uname phy:/dev/zvol/dsk/rpool/zvol/domu-21-root) > > > Pool rpool2 should be rename to rpool. > But pool rpool is online, no rename is possible. > Howto rename rpool2 to rpool (with zdb) offline? > > regards Heiko > > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
On 2012-12-03 01:15, Phillip Wagstrom wrote:> You can''t change the name of a zpool without importing it. > > For what you''re attempting to do, why not attach a larger vdisk and mirror the existing disk in rpool? Then drop the smaller vdisk and you''ll have a larger rpool. >In general, I''d do the renaming with a "different bootable media", including a LiveCD/LiveUSB, another distro that can import and rename this pool version, etc. - as long as booting does not involve use of the old rpool. Phillip however has a good point about mirroring onto a larger disk. This should also carry over your old pool''s attributes (bootfs, name, etc.) - however you should likely have to use installgrub on the new disk image. When you detach the old mirror half, you''d automatically have a larger pool on the remaining disk image.> dom0 # xm list $vm -l | egrep "vbd|:disk|zvol" > (vbd > (dev xvda:disk) > (uname phy:/dev/zvol/dsk/rpool/zvol/domu-2-root) > (vbd > (dev xvdb:disk) > (uname phy:/dev/zvol/dsk/rpool/zvol/domu-21-root)By far, the easiest approach in your case would be to just increase the host''s zfs volume which backs your old rpool and use autoexpansion (or manual expansion) to let your VM''s rpool capture the whole increased virtual disk. If automagic doesn''t work, I posted about a month ago about the manual procedure on this list: http://mail.opensolaris.org/pipermail/zfs-discuss/2012-November/052712.html HTH, //Jim Klimov
phillip.wagstrom wrote:> You can''t change the name of a zpool without importing it.bad news... i hoped edit poolname with zdb or hexedit.> > For what you''re attempting to do, why not attach a larger vdisk and mirror the existing disk in rpool? Then drop the smaller > vdisk and you''ll have a larger rpool. > > Alternatively, take a look at "beadm" as it should have a means of creating a new BE on your rpool2, though I suspect you will > have to install grub on it to make it bootable once you remove the old rpool.I''ve already tested: beadm create -p $dstpool $bename beadm list zpool set bootfs=$dstpool/ROOT/$bename $dstpool beadm activate $bename beadm list init 6 - result: root at opensolaris:~# init 6 updating //platform/i86pc/boot_archive updating //platform/i86pc/amd64/boot_archive Hostname: opensolaris WARNING: pool ''rpool1'' could not be loaded as it was last accessed by another system (host: opensolaris hostid: 0xc08358). See: http://www.sun.com/msg/ZFS-8000-EY ...hang... - seen to be a bug... regards Heiko
jimklimov wrote:> In general, I''d do the renaming with a "different bootable media", > including a LiveCD/LiveUSB, another distro that can import and > rename this pool version, etc. - as long as booting does not > involve use of the old rpool.Thank you. I will test it in the coming days. btwn:> ... > By far, the easiest approach in your case would be to just > increase the host''s zfs volume which backs your old rpool > and use autoexpansion (or manual expansion) to let your VM''s > rpool capture the whole increased virtual disk.---%<--- - test1 autoexpand # zpool set autoexpand=on rpool cannot set property for ''rpool'': invalid property ''autoexpand'' -> autoexpand not supported -> create new vol ---%<---> > If automagic doesn''t work, I posted about a month ago about > the manual procedure on this list: > > http://mail.opensolaris.org/pipermail/zfs-discuss/2012-November/052712.htmlprocedure work on 2. disk, but i cannot use "zpool import" on rpool... regards Heiko
On 2012-12-03 20:35, Heiko L. wrote:> I''ve already tested: > beadm create -p $dstpool $bename > beadm list > zpool set bootfs=$dstpool/ROOT/$bename $dstpool > beadm activate $bename > beadm list > init 6 > > - result: > root at opensolaris:~# init 6 > updating //platform/i86pc/boot_archive > updating //platform/i86pc/amd64/boot_archive > > Hostname: opensolaris > WARNING: pool ''rpool1'' could not be loaded as it was last accessed by another system (host: opensolaris hostid: 0xc08358). See: > http://www.sun.com/msg/ZFS-8000-EY > ...hang... > > - seen to be a bug...You wrote you use opensolaris - if literally true, this is quite old and few people would say definitely which bugs to expect in which version. I might guess (hope) your ultimate goal by increasing the disk is to upgrade the VM to a more current build, like OI or Sol11? Still, while booted from the old rpool, after activating the new one, you could also "zpool export rpool1" in order to mark it as cleanly exported and not potentially held by another OS instance. This should allow to boot from it, unless some other bug steps in... //Jim
On 2012-12-03 20:51, Heiko L. wrote:> jimklimov wrote: > >> In general, I''d do the renaming with a "different bootable media", >> including a LiveCD/LiveUSB, another distro that can import and >> rename this pool version, etc. - as long as booting does not >> involve use of the old rpool. > Thank you. I will test it in the coming days.Well then, hopefully this (other media to boot) will help with that (forcing the old rpool to expand)...>> If automagic doesn''t work, I posted about a month ago about >> the manual procedure on this list: >> >> http://mail.opensolaris.org/pipermail/zfs-discuss/2012-November/052712.html > procedure work on 2. disk, > but i cannot use "zpool import" on rpool...