Duplicating drive without losing data on original?

Status
Not open for further replies.

Something

Explorer
Joined
Jan 31, 2015
Messages
93
Again, thank you all so much for the help. This has been fun, informative and helpful. I'll setup SMART testing and do a ZFS snapshot. Details soon.

It's clear
Code:
pool: freenas-boot

state: ONLINE

  scan: scrub repaired 0 in 0h2m with 0 errors on Fri Jul 17 23:48:53 2015

config:



NAME        STATE     READ WRITE CKSUM

freenas-boot  ONLINE       0     0     0

  da0p2     ONLINE       0     0     0



errors: No known data errors



  pool: wdred1

state: ONLINE

  scan: scrub repaired 0 in 7h25m with 0 errors on Sat Jul 18 06:22:50 2015

config:



NAME                                          STATE     READ WRITE CKSUM

wdred1                                        ONLINE       0     0     0

  gptid/843fd539-a8f2-11e4-8af0-448a5b8b7959  ONLINE       0     0     0



errors: No known data errors



  pool: wdred2

state: ONLINE

  scan: scrub repaired 0 in 0h0m with 0 errors on Fri Jul 17 23:45:55 2015

config:



NAME                                          STATE     READ WRITE CKSUM

wdred2                                        ONLINE       0     0     0

  gptid/5d32b6f1-2d00-11e5-b9b1-448a5b8b7959  ONLINE       0     0     0



errors: No known data errors


With the latest versions of 9.3, SMART tests may be scheduled automatically with a new volume (can't say for sure, but I think I remember seeing that as a recent change), but that isn't the case with all 9.3 versions, and it definitely wasn't the case with anything earlier. However, you can (and should) schedule them yourself. I run a short test daily and a long test weekly, which may be a little more often than necessary in both cases, but is reasonable. It's discussed in the manual at http://doc.freenas.org/9.3/freenas_tasks.html#s-m-a-r-t-tests. Also make sure you have an email address set up so that and SMART errors will be reported.
Okie dokie, doing that.

With that said, there are no apparent problems with your pool. The last scrub found no errors, and the SMART data doesn't show any trouble with your drive. If you're concerned about the security of your data, add redundancy to your pool. You can add a second disk as a mirror to the first (though unfortunately not through the GUI; you'd need to do that at the CLI), but to end up with some sort of RAIDZ configuration you would need to back up the data, destroy the pool, and recreate it in the desired configuration.
Heh, now if only I were made of money... time for a third WD Red maybe...

As to the scrub, I don't know of more detailed documentation, but if it's out there it's probably in either the OpenZFS docs or the Oracle ZFS docs. The latter may not be 100% applicable, since ZFS forked a while back.
Thank you.

Technical explanation of scrubs?

ZFS reads every block it has allocated.

That's basically it. ZFS always corrects data whenever it reads it, if necessary and possible.
You're the most concise engie i've ever met. Thank you.

By default FreeNAS checks SMART status every 30 minutes, but that's a completely separate process from running SMART tests, which seems to be a source of considerable confusion. To put is simply, drives update their SMART attributes continuously, but you or the system can initiate short or extended SMART tests too. You should, because that way you have a more comprehensive picture of drive health.
Mmmm, cheers.

Your setup begs the question, why are you even using ZFS? With no redundancy in your pool, you're missing out on most of the benefits. Is it just that you like the FreeNAS GUI as a system admin tool, or is it the plugins, or what? I'm genuinely curious.
Well I mainly built this to scale, and with regrets upon regrets upon regrets. Like using consumer hardware in the first place. Selling the mobo and CPU is going to be fun, though i'll pull that off. And going with a single WD Red in the first place.

Some of my decisions do defeat the purpose and that makes them mistakes. My main goal in all this has been a system that scales to handle backups, as I could very easily decide "time for 3x4TB WD Black RAID5 for recording, let's do this!" and not want to risk data loss with my rendered videos. Learning FreeNAS and being less hopeless when it comes to IT matters also doesn't hurt.

I had a Seagate backup drive, but I very quickly found out that I had been more or less scammed. Windows backup doesn't function with it, Time Machine was...well I didn't even make the attempt. Even manually copy-pasting files to it would just randomly fail. My data is fairly important to me, so I decided that it was time I do it right. I have a bunch of machines and I want to be able to back them all up, something that makes a NAS really shine. That, and FreeNAS gives me a level of control (hardware or otherwise) to scale and build exactly what I want. Five years down the line, I still want to have the same box sitting there for backups. Maybe some upgrades, but more or less, something I can keep for years upon years.

Difficult as all of this is, it's been a great little learning process for me. About two years back I had to start using the command line (shocking as that is for a computer scientist), determined to face my fears and preference for GUIs and now I really love using the command line. FreeNAS has encouraged me to broaden my horizons with the command line, so I now have experience with the command line on a variety of systems.
 
Last edited:

Something

Explorer
Joined
Jan 31, 2015
Messages
93
Epl8MGa.png


Does this look alright?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
It looks fine. You can include more than one drive in a scheduled test (so you could have one long test covering both ada0 and ada1, for example), but what you have should work too.
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
It doesn't seem to allow for multiple drives selected oddly enough.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
It should. Did you try shift-clicking or control-clicking on the second drive? I just tried it on my system and it still allows selecting multiple drives. It'd be pretty unwieldy otherwise with larger pools (I only have 12 disks in my pool; some other folks here have lots more).
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
Well now I just feel stupid. I tried CMD and CTRL but not Shift clicking. That worked...

Time I got something to eat.
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
From ssh...

Code:
~# zfs list

NAME                                                      USED  AVAIL  REFER  MOUNTPOINT

freenas-boot                                             3.47G  25.3G    31K  none

freenas-boot/ROOT                                        3.41G  25.3G    31K  none

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501241715         820K  25.3G   933M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501301837        1.55M  25.3G   934M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201502232343        2.08M  25.3G   946M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201505130355        2.05M  25.3G   995M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506232120        2.93M  25.3G  1.00G  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506292332        3.40G  25.3G  1.00G  /

freenas-boot/ROOT/Initial-Install                           1K  25.3G   932M  legacy

freenas-boot/ROOT/default                                  56K  25.3G   933M  legacy

freenas-boot/grub                                        56.9M  25.3G  11.2M  legacy

wdred1                                                   2.05T  1.46T   104K  /mnt/wdred1

wdred1/.system                                           4.62M  1.46T  2.48M  legacy

wdred1/.system/configs-74564c350ac445f98d2696edfb9a82ed    96K  1.46T    96K  legacy

wdred1/.system/cores                                      784K  1.46T   784K  legacy

wdred1/.system/rrd-74564c350ac445f98d2696edfb9a82ed        96K  1.46T    96K  legacy

wdred1/.system/samba4                                     380K  1.46T   380K  legacy

wdred1/.system/syslog-74564c350ac445f98d2696edfb9a82ed    832K  1.46T   832K  legacy

wdred1/jails                                             2.33G  1.46T   128K  /mnt/wdred1/jails

wdred1/jails/.warden-template-standard--x64              1.55G  1.46T  1.55G  /mnt/wdred1/jails/.warden-template-standard--x64

wdred1/jails/<removed>                                   433M  1.46T  1.75G  /mnt/wdred1/jails/<removed>

wdred1/jails/<removed>                                  369M  1.46T  1.69G  /mnt/wdred1/jails/<removed>

wdred1/<removed>                                      544G  1.46T   544G  /mnt/wdred1/<removed>

wdred1/<removed>                                        141G  1.46T   141G  /mnt/wdred1/<removed>

wdred1/<removed>                                       802G  1.46T   802G  /mnt/wdred1/<removed>

wdred1/<removed>                                       250G  1.46T   250G  /mnt/wdred1/<removed>

wdred1/<removed>                                        317G  1.46T   317G  /mnt/wdred1/<removed>

wdred1/<removed>                                     41.2G  1.46T  41.2G  /mnt/wdred1/<removed>

wdred2                                                    312K  3.51T    96K  /mnt/wdred2

~# zfs snapshot wdred1@001

~# zfs send wdred1@001 | zfs recv -d wdred2

cannot receive new filesystem stream: destination 'wdred2' exists

must specify -F to overwrite it

warning: cannot send 'wdred1@001': Broken pipe

~# zfs send -F wdred1@001 | zfs recv -d wdred2

invalid option 'F'

usage:

    send [-DnPpRvLe] [-[iI] snapshot] <snapshot>

    send [-Le] [-i snapshot|bookmark] <filesystem|volume|snapshot>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow

cannot receive: failed to read from stream

~# zfs send wdred1@001 | zfs recv -F -d wdred2

~# zfs list

NAME                                                      USED  AVAIL  REFER  MOUNTPOINT

freenas-boot                                             3.47G  25.3G    31K  none

freenas-boot/ROOT                                        3.41G  25.3G    31K  none

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501241715         820K  25.3G   933M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501301837        1.55M  25.3G   934M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201502232343        2.08M  25.3G   946M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201505130355        2.05M  25.3G   995M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506232120        2.93M  25.3G  1.00G  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506292332        3.40G  25.3G  1.00G  /

freenas-boot/ROOT/Initial-Install                           1K  25.3G   932M  legacy

freenas-boot/ROOT/default                                  56K  25.3G   933M  legacy

freenas-boot/grub                                        56.9M  25.3G  11.2M  legacy

wdred1                                                   2.05T  1.46T   104K  /mnt/wdred1

wdred1/.system                                           4.62M  1.46T  2.48M  legacy

wdred1/.system/configs-74564c350ac445f98d2696edfb9a82ed    96K  1.46T    96K  legacy

wdred1/.system/cores                                      784K  1.46T   784K  legacy

wdred1/.system/rrd-74564c350ac445f98d2696edfb9a82ed        96K  1.46T    96K  legacy

wdred1/.system/samba4                                     380K  1.46T   380K  legacy

wdred1/.system/syslog-74564c350ac445f98d2696edfb9a82ed    832K  1.46T   832K  legacy

wdred1/jails                                             2.33G  1.46T   128K  /mnt/wdred1/jails

wdred1/jails/.warden-template-standard--x64              1.55G  1.46T  1.55G  /mnt/wdred1/jails/.warden-template-standard--x64

wdred1/jails/<redacted>                                   433M  1.46T  1.75G  /mnt/wdred1/jails/<redacted>

wdred1/jails/<redacted>                                  369M  1.46T  1.69G  /mnt/wdred1/jails/<redacted>

wdred1/<redacted>                                      544G  1.46T   544G  /mnt/wdred1/<redacted>

wdred1/<redacted>                                        141G  1.46T   141G  /mnt/wdred1/<redacted>

wdred1/<redacted>                                       802G  1.46T   802G  /mnt/wdred1/<redacted>

wdred1/<redacted>                                       250G  1.46T   250G  /mnt/wdred1/<redacted>

wdred1/<redacted>                                        317G  1.46T   317G  /mnt/wdred1/<redacted>

wdred1/<redacted>                                     41.2G  1.46T  41.2G  /mnt/wdred1/<redacted>

wdred2                                                    320K  3.51T   104K  /mnt/wdred2

~# zfs snapshot -r wdred1@002

~# zfs send -R wdred1@002 | zfs recv -d wdred2

cannot receive new filesystem stream: destination 'wdred2' exists

must specify -F to overwrite it

warning: cannot send 'wdred1/jails@002': Broken pipe

~# zfs snapshot -r wdred1@003

~# zfs send -R wdred1@003 | zfs recv -F -d wdred2

cannot receive new filesystem stream: destination has snapshots (eg. wdred2@001)

must destroy them to overwrite it

warning: cannot send 'wdred1/jails@002': Broken pipe

warning: cannot send 'wdred1/jails@003': Broken pipe


Well, that didn't work too well. Anyone have a clue what's going wrong?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
You are trying to overwrite the wdred2 dataset.

You can create a subdataset under wdred2 (like wdred2/1stattempt) and replicate to that.

Have you tried using the GUI? You can create a replication job to "localhost". If you are going to try this, I'd suggest destroying wdred2 first.
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
You are trying to overwrite the wdred2 dataset.

You can create a subdataset under wdred2 (like wdred2/1stattempt) and replicate to that.

Have you tried using the GUI? You can create a replication job to "localhost". If you are going to try this, I'd suggest destroying wdred2 first.
I tried via CLI with a new subdataset and it failed.

Code:
~# zfs list

NAME                                                      USED  AVAIL  REFER  MOUNTPOINT

freenas-boot                                             3.47G  25.3G    31K  none

freenas-boot/ROOT                                        3.41G  25.3G    31K  none

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501241715         820K  25.3G   933M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501301837        1.55M  25.3G   934M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201502232343        2.08M  25.3G   946M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201505130355        2.05M  25.3G   995M  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506232120        2.93M  25.3G  1.00G  /

freenas-boot/ROOT/FreeNAS-9.3-STABLE-201506292332        3.40G  25.3G  1.00G  /

freenas-boot/ROOT/Initial-Install                           1K  25.3G   932M  legacy

freenas-boot/ROOT/default                                  56K  25.3G   933M  legacy

freenas-boot/grub                                        56.9M  25.3G  11.2M  legacy

wdred1                                                   2.05T  1.46T   104K  /mnt/wdred1

wdred1/.system                                           5.13M  1.46T  2.48M  legacy

wdred1/.system/configs-74564c350ac445f98d2696edfb9a82ed    96K  1.46T    96K  legacy

wdred1/.system/cores                                      784K  1.46T   784K  legacy

wdred1/.system/rrd-74564c350ac445f98d2696edfb9a82ed        96K  1.46T    96K  legacy

wdred1/.system/samba4                                     540K  1.46T   380K  legacy

wdred1/.system/syslog-74564c350ac445f98d2696edfb9a82ed   1.09M  1.46T   872K  legacy

wdred1/jails                                             2.33G  1.46T   128K  /mnt/wdred1/jails

wdred1/jails/.warden-template-standard--x64              1.55G  1.46T  1.55G  /mnt/wdred1/jails/.warden-template-standard--x64

<redacted>

wdred2                                                    416K  3.51T   104K  /mnt/wdred2

wdred2/backupattempt                                       96K  3.51T    96K  /mnt/wdred2/backupattempt

~# zfs snapshot wdred1@004

~# zfs send wdred1@004 | zfs recv -d wdred2/backupattempt

cannot receive new filesystem stream: destination 'wdred2/backupattempt' exists

must specify -F to overwrite it

~# zfs send wdred1@004 | zfs recv -d wdred2/backupattempt1

cannot receive: specified fs (wdred2/backupattempt1) does not exist

warning: cannot send 'wdred1@004': Broken pipe

~# mkdir /mnt/wdred2/backupattempt2

~# zfs send wdred1@004 | zfs recv -d wdred2/backupattempt1

cannot receive: specified fs (wdred2/backupattempt1) does not exist

warning: cannot send 'wdred1@004': Broken pipe

~# zfs send wdred1@004 | zfs recv -d wdred2/backupattempt2

cannot receive: specified fs (wdred2/backupattempt2) does not exist

warning: cannot send 'wdred1@004': Broken pipe
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
aXkVby8.png

xepYt79.png


Will this work?
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
I fixed up the replication and it worked, the snapshot was copied. How do I get all of the original data across now that that's done?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I'm confused. If you took a snapshot and the replication worked, then the data will be in the target destination.

Remember this only creates a point-in-time copy of everything (and if you set it up in the GUI, will regularly create additional point-in-time backups according to the snapshot and replication settings you chose). If you want continuous protection of your drive (with the added capability of enhanced error correction), then a better solution would be to add your second drive as a mirror to your first one using the "Manage Volumes" part of the GUI.
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
zj5RMmp.png


I'm not looking for continuous protection of the drive but I wanted to have certain (not arbitrary) or all data on the first drive copied exactly to the second (permissions, ownership, files, folders, etc...).
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Looking at your screen shot, your wdred2 dataset doesn't really look like it has any data in it. You might want to check the status of replication.
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
dIFhKsi.png


oPl48xv.png


I'm doing something wrong, aren't I?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Is your replication setup to be recursive? It looks like it's only replicating whatever is in the root folder.

Sent from my Nexus 7 using Tapatalk
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
Recursively replicate and remove stale snapshot on remote side:

I'm going to go ahead and check that > <

I even set the snapshot to be recursive ahhhhhhhhhhhhhhh

Recursion is going to be the death of me.

Edit: email alert

Replication wdred1 -> 192.168.1.2:wdred2/attempt3 failed: cannot receive incremental stream: destination 'wdred2/attempt3/jails' does not exist
Error 33 : Write error : cannot write compressed block

I didn't set a dedicated user, root should be able to make the directory automatically.
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
What's wrong with just mirroring the drives?
 

Something

Explorer
Joined
Jan 31, 2015
Messages
93
Status
Not open for further replies.
Top