Latest News:
2019-02-21: XigmaNAS 11.2.0.4.6536 - released!

Latest BETA Release:
2019-02-21: XigmaNAS 12.0.0.4.6536 - BETA released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS cost money, please consider a donation to our project so we can continue to offer you the best.
We need your support! eg: PAYPAL

Rename vdev and pool

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
perkinma
NewUser
NewUser
Posts: 2
Joined: 26 Sep 2014 14:34
Status: Offline

Rename vdev and pool

#1

Post by perkinma » 26 Sep 2014 14:44

I have a RAIDZ2 server with a virtual device name of ServerThree_vdev and a pool name of ServerThree.

The old ServerTwo I had is now decommissioned and gone and I want to change all the RAIDZ2 ServerThree references to ServerTwo. Is this possible? Or is the only way to move all the data off, destroy the virtual device / pool and start from scratch?

I have only 47% of my RAIDZ2 capacity (a touch less than half) - could I create a new vdev spanning the same disks as the previous vdev, create a new pool, move everything over and then destroy the old vdev and pool?

Thanks in advance for the assistance, much appreciated.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4772
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Rename vdev and pool

#2

Post by raulfg3 » 26 Sep 2014 15:01

12.0.0.4 - BETA (revision 6412)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

perkinma
NewUser
NewUser
Posts: 2
Joined: 26 Sep 2014 14:34
Status: Offline

Re: Rename vdev and pool

#3

Post by perkinma » 26 Sep 2014 15:11

Thanks raulfg3. I had found both references. With the first link, it wasn't clear to me whether there was any data in the pool and therefore whether data was preserved in the export /import with new name process? Given you have linked it here I will assume now that the data is retained and it wasn't just an empty pool.

With the second link it appeared to deal with filesystems within the pool only, not the pool itself. I will go back and reread it again.

Thanks again for the pointers.

fumantsu
experienced User
experienced User
Posts: 76
Joined: 04 Mar 2014 12:15
Location: Athens->Brno
Status: Offline

Re: Rename vdev and pool

#4

Post by fumantsu » 26 Sep 2014 16:38

I have tried many times. When you export the pool it is just like when you select in Windows "Safe remove hardware". All the information about the pool it is saved internally. Then you can import your pool in ANY system that have ZFS (with the version/features matching yours). No user data is touched.
Fractal Node 304, Avoton C2550 Quad-Core Processor, 8GB RAM ECC, 4 x 4TB WD RED in mirrors , NAS4Free 9.2.0.1 build 972

pcrow
NewUser
NewUser
Posts: 5
Joined: 07 Jan 2015 04:15
Status: Offline

Re: Rename vdev and pool

#5

Post by pcrow » 09 Jan 2015 17:43

I'm new to this, so I didn't understand that the pool name would show up in all the mount points, and you can't rename it through the GUI. The above command line trick for renaming the pool (export/import) works great, but it leaves out the need to edit your /conf/config.xml to change any references from the old name to the new name. (I also had to remount /cf to be rw.) In my case, my old pool name was distinct, so it was easy to use sed to change all the references. The only thing this left messed up was the mount point. It turns out that the mount point is set in ZFS, so you have to use ZFS commands to change it, as described at the page:
http://docs.oracle.com/cd/E19253-01/819-5461/gaztn/

So in summary, I used a four-step process:
1) Rename the pool with export/import as describe above
2) Edit /conf/config.xml to change all references from the old name to the new name
3) Change the mount point in ZFS as described above
4) Reboot to be sure everything is using the new name and location as expected.

KTL
NewUser
NewUser
Posts: 13
Joined: 02 Dec 2018 01:27
Status: Offline

Re: Rename vdev and pool

#6

Post by KTL » 09 Jan 2019 17:47

Four years later...

I'd also like to rename my existing pool to something different and I've read all the above links, managed to find another link here that's also informative.

The existing pool structure is:
/mnt/oldpool
/mnt/oldpool/fs1
/mnt/oldpool/fs#

The steps I plan to try out are:

Step 1: Export the oldpool
# zpool export oldpool

Step 2: Import/rename to newpool
# zpool import oldpool newpool

Step 3: Check the mount point for fs1
# zfs get mountpoint newpool/fs1

Step 4: Change the mount point for fs1
# zfs set mountpoint=/mnt/newpool/fs1 newpool/fs1

Step 5: Repeat steps 3 and 4 for other fs#

Questions
  1. Do I need to create the newpool first or is the export/import sufficient?
  2. Can these steps be performed in the GUI (version 4315)?
  3. Should the steps be performed in the console shell instead?
  4. Do I need to update the paths in CIFS/SMB Settings/Shares?
Apology for the noob questions, but I figured to ask before doing something regrettable. Thanks.
Last edited by KTL on 03 Feb 2019 03:25, edited 1 time in total.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4772
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Rename vdev and pool

#7

Post by raulfg3 » 09 Jan 2019 19:45

only step 1 and 2 is enough.

you do not need to create newpool, is automatically created when you import newpool.
12.0.0.4 - BETA (revision 6412)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

KTL
NewUser
NewUser
Posts: 13
Joined: 02 Dec 2018 01:27
Status: Offline

Re: Rename vdev and pool

#8

Post by KTL » 10 Jan 2019 16:17

Thanks for the information. Do you recommend to use the console shell or the GUI is good enough?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4772
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Rename vdev and pool

#9

Post by raulfg3 » 10 Jan 2019 20:45

I recommend the shell, but remember to sync the webGUI and the real life at the end.

Disks > ZFS > Configuration > Synchronize
12.0.0.4 - BETA (revision 6412)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

KTL
NewUser
NewUser
Posts: 13
Joined: 02 Dec 2018 01:27
Status: Offline

Re: Rename vdev and pool

#10

Post by KTL » 02 Feb 2019 15:10

I finally managed to get this task done. I still did steps 3 and 4 to clean up the oldpool remnants. Fortunately, I was able to (re)mount the newpool and all the files in the datasets have reappeared once again. Thanks!

Post Reply

Return to “ZFS (only!)”