how to Clone existing disc to new larger disc

Status
Not open for further replies.
Joined
Sep 2, 2015
Messages
1
Hello, I'm a newbie. I set up a prototype system using an "old" 1TB disc. I'm happy with my ftp, backup CIFS and experiments with Couchpotato and Sickbeard, so now rather than start again from scratch I'd like to transfer what I have to a new WD RED 6TB disc. I've made a snapshot of the existing disc but can't find step by step instructions for replicating the snapshot onto a localhost disc. When I've made the clone I'd like to power-off and swap discs, power back up and everything carries on using the 6TB disc. I'll later try to make a raid with another 6TB disc but I can't afford to buy for a few weeks. I'll also create a new pool with the old 1TB disc as network store for a security camera. Any tips or help would be very much appreciated. David
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
So, you're intending to eventually do a mirror of two 6TB disks?

I would suggest that you hook up the new 6TB disk. Very carefully add it to the existing mirror vdev. The system will let you do this. Once you do, it will make a mirror copy ("resilvering") of the 1TB onto the 6TB (because the 6TB can easily hold the 1TB's data).

Then you make sure "zpool get autoexpand" reports that autoexpand is on.

Then you detach the 1TB disk from the mirror. Suddenly you have a 6TB pool.

In N weeks, you add the next 6TB disk to the existing mirror vdev.

However, caution. You can screw things up badly if you don't do the right things in the right way at the right time.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You have a single-disk pool, and you want to replace that disk with a larger one? Simple. Just replace the disk through the GUI in (almost) the same way that you would a failed disk. Power down the server and install the new disk. Boot the server, log in to the web GUI, go to Storage, click on your pool, and click the volume status button at the bottom (looks like a sheet of notebook paper). On the next screen, select your drive, then click the Replace button at the bottom. In the window that pops up, choose the new disk from the drop-down. When it's finished copying over all the data, it will automatically offline the old disk. At your convenience, power down the server and remove it.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Very carefully add it to the existing mirror vdev
What existing mirror vdev? Turning single disks into mirrors still isn't in the FreeNAS GUI.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Really? I thought that had been taken care of long ago.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Nope. It was said to be slated for 9.3, but it didn't make it. It's now supposed to be in 10.0. Since I'm not following the nightlies of 10, I have no idea if it's there, or what its condition is.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
FreeBSD, Linux and all the variant has never been designed to be user friendly and trivial is not a word widely used around here. It is just my opinion by the way.
There is another route I would have taken, and I have actually taken it quite a few time and that is using replication.
This has the advantage of being possibly more resilient as converting the 1TB into a mirror by inserting the 6TB drive and repurposing the array. At the end of the process you will have two identical volume, one can be used as your new backup.

With my approach, you keep the 1TB setup you have, insert the 6TB drive, create a new volume, create a recursive snapshot of your 1TB volume and perform replication to 6TB drive.

One possible caveat woud be the name of the pool will be different and Freenas config will have to be adjusted
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, replication would work, and if you look in other threads you'll see it recommended pretty frequently. You can even, if needed and/or desired, rename the new pool to be the same name as the old pool, so the rest of your configuration doesn't have to change. It is a more flexible alternative, allowing you to replicate to larger or smaller pools (as long as it's large enough to hold the data, of course), and to pools in any configuration. But for OP's scenario, I believe the disk replacement I proposed is a better answer. It leaves the same end result (the old disk is still usable, and still has all its data), there's no need to rename the pool or adjust any configuration settings, and it's a much simpler process: install new disk, replace disk through GUI, remove old disk at leisure.

"Trivial" is, of course, a relative thing. In the context in which @Ericloewe used it, he was referring to the difficulty to the FreeNAS devs of adding the feature, so end-user-friendliness isn't really an issue. I hope we can safely assume that they're familiar with FreeBSD. It's been said that Unix is very user-friendly, it's just very selective about who it makes friends with.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
I have a similar problem to the first poster, David Broster, and am a newbie++. I had a 1TB drive working on its own and wanted to replace this with a 3TB RAID1/mirrored setup. Following this post, I successfully replaced the 1TB with one of the 3TB drives by, as suggested above by Danb35 (thank you danb35), and removed the 1TB drive once the system had silvered the data from 1TB to the 3TB drive. I've looked at the forums and other sources and creating a mirrored setup seems very complex and much CLIing which I'm still new at. I want to be able to do this without having to reconfigure my permissions and user setup if possible. I have saved that configuration so I'm wondering should I create a new mirrored pool/volume, and therefore have to recopy all the data to the mirrored drives all over again, and then apply the saved setup configuration somehow? Or is this even possible given the configuration might need to change? I see in other areas of the forums, it is suggested that Freenas version 10 will provide a simpler GUI method of doing what I want to do, but there's no mention of when this might be available.

Any help greatly appreciated. I am running Freenas 9.3 on an ix truenas system.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Adding a second disk as a mirror will taking some CLI tinkering to do it right. However, if done right, there won't be any changes to data/users/permissions/configuration. Unfortunately, I haven't done this myself, so I can't comment from experience on the best way to go about it.

Yes, it's said that this feature will be in FreeNAS 10, but there hasn't been any release date stated. I don't think I'd expect it this year in any case. It was also said that this feature would be in 9.3, but then it got dropped before that version was released.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Adding a second disk as a mirror will taking some CLI tinkering to do it right. However, if done right, there won't be any changes to data/users/permissions/configuration. Unfortunately, I haven't done this myself, so I can't comment from experience on the best way to go about it.

Yes, it's said that this feature will be in FreeNAS 10, but there hasn't been any release date stated. I don't think I'd expect it this year in any case. It was also said that this feature would be in 9.3, but then it got dropped before that version was released.
Thanx Danb35. Even a basic suggestion as to how I go about this would be mucho appreciated. Guess I'll just have to trial and error as I go along but need some pointers in the right direction.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Last edited:

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
It's a start. You probably want to look into partitioning the new drive and using the GPTID instead of the whole drive. Perhaps someone else can chime in on that.

Code:
[root@freenas-test] ~# zpool status
  pool: test1
state: ONLINE
  scan: none requested
config:

        NAME                                          STATE     READ WRITE CKSUM
        test1                                         ONLINE       0     0     0
          gptid/0b4989ca-6d38-11e5-82a8-005056b1714a  ONLINE       0     0     0

errors: No known data errors
[root@freenas-test]
[root@freenas-test] ~# zpool attach test1 gptid/0b4989ca-6d38-11e5-82a8-005056b1714a /dev/da3
[root@freenas-test] ~# zpool status
  pool: test1
state: ONLINE
  scan: resilvered 1.16M in 0h0m with 0 errors on Wed Oct  7 17:24:36 2015
config:

        NAME                                            STATE     READ WRITE CKSUM
        test1                                           ONLINE       0     0     0
          mirror-0                                      ONLINE       0     0     0
            gptid/0b4989ca-6d38-11e5-82a8-005056b1714a  ONLINE       0     0     0
            da3                                         ONLINE       0     0     0

errors: No known data errors
[root@freenas-test] ~# 


upload_2015-10-7_17-28-3.png
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Thanks depasseg. I have tried the 'attach' option only to discover that the 2nd 3TB drive is already seen as part of the overall pool/volume - named ZigNAS (not sure how that happened, but I must have done something) and I don't know how to detach it from the pool before following your instructions in 'zpool attach'. This the error response in shell:
The following errors must be manually repaired:
/dev/ada2 is part of active pool 'ZigNAS'

See snapshot below of the 2 disks under 'View disks':
Freenas pool error_01.JPG
TIA.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Yeah.. that mirror is not setup properly.. notice it says da3 and not a gpt-id.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Hi guys. Made a complete mess of it so going back to the start. I have separate backups of all my data. I will build everything from the beginning in the hope I also learn some stuff as I go along. My son, a software engineer, had helped me when I first set up Freenas a few months back. He's living in Canada now (I'm in Ireland) so I'm just going to try and get on top of this myself. The difficulty is in finding the time to consistently work at it so I don't leave it too long in between sessions and then forget what I had previously gone thru (retaining material gets harder as you get older!). Appreciate all the help. It's amazing how much time and energy people can give to helping others.
 
Status
Not open for further replies.
Top