Jonathan Loran
2007-Apr-14 06:20 UTC
[zfs-discuss] Move data from the zpool (root) to a zfs file system
Hi List, As a ZFS newbie, I foolishly copied my data set to the root zpool file system (a large iSCSI SAN array). Thus: # zpool create -f iscsi c4t19d0 c4t20d0 c4t21d0 c4t22d0 c4t23d0 c4t24d0 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT iscsi 9.53T 64.5K 5.34T 0% ONLINE - # zfs set mountpoint=/mydisks/iscsi iscsi Then copied almost 6TB (uncompressed) of data into a subdirectory of the root zpool: /mydisks/iscsi/fastdata. (I know, RTFM before using ZFS). So, now for many obvious reasons I want to move my data into a filesystem below my iscsi zpool (call: iscsi/fastdata). So I tried the following: # cd /mydisks/iscsi # ls fastdata/ # mv fastdata fastdata.old/ # zfs snapshot iscsi at today # zfs clone iscsi at today iscsi/fastdata # zfs list NAME USED AVAIL REFER MOUNTPOINT iscsi 4.04T 5.34T 4.04T /mydisks/iscsi iscsi at today 0 - 4.04T - iscsi/fastdata 0 5.34T 4.04T /mydisks/iscsi/fastdata # zfs promote iscsi/fastdata # zfs list NAME USED AVAIL REFER MOUNTPOINT iscsi 4.04T 5.34T 4.04T /mydisks/iscsi iscsi/fastdata 4.04T 5.34T 4.04T /mydisks/iscsi/fastdata iscsi/fastdata at today 0 - 4.04T - Clean up the original subdirectory: # pwd /mydisks/iscsi # rm -r fastdata.old/ .. some time later... # zfs list NAME USED AVAIL REFER MOUNTPOINT iscsi 4.04T 5.34T 27.5K /mydisks/iscsi iscsi/fastdata 4.04T 5.34T 4.04T /mydisks/iscsi/fastdata iscsi/fastdata at today 0 - 4.04T - And in new file system: # pwd /mydisks/iscsi/fastdata # mv fastdata.old/* . # rmdir fastdata.old OK, so far so good. But now I want to remove the snapshot, and this is where I''m stuck: # zfs destroy iscsi/fastdata at today cannot destroy ''iscsi/fastdata at today'': dataset already exists # zfs destroy -r iscsi/fastdata at today cannot destroy ''iscsi/fastdata at today'': snapshot is cloned no snapshots destroyed # zfs list -o origin iscsi ORIGIN iscsi/fastdata at today As you can see, the origin of the snapshot is the iscsi zpool root file system. D''oh! Furthermore, if I promote the iscsi root FS, the iscsi/fastdata subdirectory becomes a clone: # zfs promote iscsi # zfs list -o origin iscsi ORIGIN - # zfs list -o origin iscsi/fastdata ORIGIN iscsi at today So, I can promote the iscsi zpool FS, but then the new iscsi/fastdata FS becomes a clone of the snapshot. I can''t have both iscsi and iscsi/fastdata promoted so I can clean out the snapshot. Am I stuck just copying the data into the new file system, which will take, by my calculations 12 days, or is there another secret approach I can take here? Yes, I''m an idiot for not creating the file system in the first place, but you learn from your mistakes, right? Any help/suggestions would be very much appreciated. Thanks, Jon -- - _____/ _____/ / - Jonathan Loran - - - / / / IT Manager - - _____ / _____ / / Space Sciences Laboratory, UC Berkeley - / / / (510) 643-5146 jloran at ssl.berkeley.edu - ______/ ______/ ______/ AST:7731^29u18e3
Matthew Ahrens
2007-May-06 22:46 UTC
[zfs-discuss] Move data from the zpool (root) to a zfs file system
Jonathan Loran wrote:> So, I can promote the iscsi zpool FS, but then the new iscsi/fastdata FS > becomes a clone of the snapshot. I can''t have both iscsi and > iscsi/fastdata promoted so I can clean out the snapshot. Am I stuck > just copying the data into the new file system, which will take, by my > calculations 12 days, or is there another secret approach I can take > here? Yes, I''m an idiot for not creating the file system in the first > place, but you learn from your mistakes, right? Any help/suggestions > would be very much appreciated.Unfortunately, there is no way to destroy or rename the topmost filesystem (the one with the same name as the pool), so you are stuck copying the data over. I believe there are some RFEs filed about this issue, if not, feel free to file them. --matt
Apparently Analagous Threads
- Zfs ignoring spares?
- No rule to make target all.R, needed by compiler.rdb building R 3.4.1 from source, Scientific Linux release 6.9 (Carbon)
- No rule to make target all.R, needed by compiler.rdb building R 3.4.1 from source, Scientific Linux release 6.9 (Carbon)
- How to properly read "zpool iostat -v" ? ;)
- No rule to make target all.R, needed by compiler.rdb building R 3.4.1 from source, Scientific Linux release 6.9 (Carbon)