Upgrade/replace SINGLE hard drive

Status
Not open for further replies.

Revilo

Dabbler
Joined
Oct 15, 2013
Messages
25
So I have a 500GB SATA HDD.
It has 1 ZFS partition called "Volume1" I have ordered a larger 1TB Hard drive and would like to know how to clone the drive.
The drive has a number of types of data on it (all stored under separate datasets like jails/media/webserver and the jails have symlinks to another volume (mounted via the 'storage' function on the plugins page). Each dataset has different permissions for multiple users and because it took such a long time to set-up I don't want to do any setting up again.

I literally just want to take the 500GB "Volume1", place it on the 1TB and call it "Volume1" and it just work. Much as you would use Acronis true image to upgrade a HDD in Windows (with it expanding the partition to fit the new drive).

I have seen post such as these but everything seems more complicated than the job I would like to achieve:
- http://forums.freenas.org/index.php?threads/expand-zfs-drive-single-disk-no-raid.13086/
- http://forums.freenas.org/index.php?threads/how-do-i-clone-usb-boot-disk.6183/
- http://forums.freenas.org/index.php...ls-to-ssd-helping-hdd-sleep.16955/#post-89106
- http://forums.freenas.org/index.php?threads/migration-from-old-volume.16445/#post-88319

Let me know if I am about the suitability of any of the above posts but I feel there must be a simpler way?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Easy.. make a pool on your new 1TB drive. ZFS replication to the new drive. Export both of your drives, then rename the "new" pool to match the "old" pool. Then do auto-import.
 

Revilo

Dabbler
Joined
Oct 15, 2013
Messages
25
This is what I understand from your post cyberjock… am I right with this guide?

Old drive: 500GB HDD with a ZFS pool called “Volume1”
New drive: 1TB HDD not formatted or imported. (I will call it Volume1new until old drive is removed)

-- Turn off all plugins and jails, stop all services except SSH
-- Create a ZFS pool called “Volume1new” using the whole of the new 1TB drive
-- Create periodic snapshot of "Volume1" [old drive] (set the snapshot frequency to larger than the time it will take to copy the volume)

-- Start a replication task (http://doc.freenas.org/index.php/Replication_Tasks) with these settings:
  1. Volume/Dataset = Volume1
  2. Remote Volume/Dataset = Volume1new
  3. Recursive = yes/tick
  4. initialise remote side = yes/tick
  5. Remote hostname = localhost
  6. Remote port = 22
  7. Remote hostkey = [click the SSH key scan button]
  8. **(also make sure public key is attached to "root" user in the accounts section too!!)**
-- Export both drives "Volume1" and "Volume1new" then import new (renamed) “Volume1” (http://forums.freenas.org/index.php?threads/renaming-volume-with-data-already-in-it.13061/)
  1. zpool export Volume1
  2. zpool export Volume1new
  3. zpool import volume1new volume1
-- Detach the new “Volume1” (un-tick the “delete shares” and “destroy data” boxes so if it goes wrong our data is still safe)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
That sounds about right.
 

Revilo

Dabbler
Joined
Oct 15, 2013
Messages
25
Errm I tried importing it today and at first "zpool export Volume1" and "zpool export Volume1new" didn't work so I tried going into the storage tab on the GUI and detach the pools. detaching worked so I tried doing "zpool import Volume1new Volume1" and it said "cannot mount '/Volume1': failed to create mountpoint" so I shut the NAS down, unplugged the old "Volume1" and booted up again.
After the boot the pool wasn't located under the storage tab in the GUI so I clicked on auto import and it didn't show up to import it. I then ran "zpool import Volume1" again and the same error occurred. I then ran "zpool status -v" which brought up this (Volume 2 is a separate volume which is working fine btw)...
Code:
# zpool status -v
  pool: Volume1
 state: ONLINE
  scan: none requested
config:
 
        NAME                                          STATE     READ WRITE CKSUM
        Volume1                                       ONLINE       0     0     0
          gptid/cab77e70-aaa8-11e3-898d-001e4f97c1ee  ONLINE       0     0     0
 
errors: No known data errors
 
  pool: Volume2
 state: ONLINE
  scan: none requested
config:
 
        NAME                                          STATE     READ WRITE CKSUM
        Volume2                                       ONLINE       0     0     0
          gptid/45774a9c-9567-11e3-ab53-001e4f97c1ee  ONLINE       0     0     0
 
errors: No known data errors


So I don't know what is going on basically!! Please help asap because there is a file I need access to soon... Thank you :smile:
 

Revilo

Dabbler
Joined
Oct 15, 2013
Messages
25
Okay I think I answered my own question. Sometimes I surprise myself when the solution isn't found on a forum and I have thought of it!!...

I thought that it was a bit odd that a function called "zpool status" would have a pool called "Volume1" in it when it was "failing to import" so I decided to try "zpool export" (which worked!!) and then I went to the GUI, loaded up auto import and saw the volume in the auto import so I let it import and hey presto! it imported!!!

I also had a problem with the plugins not showing up. I just went to the jail configuration page and clicked save config to allow it to rescan the directory and everything worked well!!!! soo pleased!

Would it be possible to get a proper guide for single drive imports?? because mine is going to have inaccuracies in it and I think it would be really useful to have a guide on it (especially now I know it works!)

Cheers cyberjock btw. :smile:
 
Status
Not open for further replies.
Top