Thanassis Tsiodras
2010-May-28 16:04 UTC
[zfs-discuss] Can I change copies to 2 *after* I have copied a bunch of files?
I''ve read on the web that copies=2 affects only the files copied *after* I have changed the setting - does this mean I have to ... bash$ cat /tmp/stupid.sh cp "$1" /tmp/ || exit 1 rm "$1" || exit 1 cp /tmp/$(basename "$1") "$1" || exit 1 bash$ gfind /path/to/... -type f -exec /tmp/stupid.sh ''{}'' ''\;'' Is there no better solution? -- This message posted from opensolaris.org
Brandon High
2010-May-28 23:51 UTC
[zfs-discuss] Can I change copies to 2 *after* I have copied a bunch of files?
On Fri, May 28, 2010 at 9:04 AM, Thanassis Tsiodras <ttsiodras at gmail.com> wrote:> Is there no better solution?If you don''t care about snapshots, you can also create a new dataset and move or copy the files to it. If you do care about snapshots, you can send/recv the dataset, which will apply the copies property and save all your snapshots. I did this when I un-dedup''d (redup''d?) some datasets. Create a target path and create copy of the dataset in it. I set the target path mountpoint to legacy to keep the new copy from trying to mount or share automatically. zfs create -o mountpoint=legacy tank/copies-foo zfs send -R tank/foo/bar at now | zfs rcv -e tank/new-foo then do a renaming monte on datasets. zfs rename tank/foo/bar tank/copies-foo/bar-old zfs rename tank/copies-foo/bar tank/foo/bar If you''re brave, you can destroy your source and just rename your new copy into place instead. -B -- Brandon High : bhigh at freaks.com
David Dyer-Bennet
2010-Jun-01 16:47 UTC
[zfs-discuss] Can I change copies to 2 *after* I have copied a bunch of files?
On Fri, May 28, 2010 11:04, Thanassis Tsiodras wrote:> I''ve read on the web that copies=2 affects only the files copied *after* I > have changed the settingThat is correct. Rewriting datasets is a feature desired for future versions (it would make a LOT of things, including shrinking pools and adding compression or extra redundancy later work). Nobody has promised a date for it that I recall. -- David Dyer-Bennet, dd-b at dd-b.net; http://dd-b.net/ Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/ Photos: http://dd-b.net/photography/gallery/ Dragaera: http://dragaera.info