![]() Those would have their own dedicated tools to copy data. Consider for example zfs or btrfs when you can take snapshots of subvolumes and branch them off. Then there are more complex file systems, where you can't really copy the data by copying files. You may also have to consider attributes of the file system themselves like the UUID, the reserved space for root, the fsck frequency, the journalling behavior, format of directories. And when copying onto a different filesystems, you have to consider the case where they don't support the same feature set. ![]() Not all tools support all of those, or when they do, you have to enable it explicitly like the -sparse, -acls. Linux attributes like immutable or append-only flags.ACLs and other extended attributes (like the ones used for SELinux).Then if you consider ext4 and most Linux file systems, you'll have to consider: sparseness: you've got that 2TB sparse file which is a VM disk image that only takes 3GB of disk space, the rest being sparse, doing a naive copy would fill up the destination drive.last modification, access and change times: only the first two can be copied using filesystem API (cp, tar, rsync.).Sometimes, we'll have to consider what to do with absolute symlinks or symlinks that point out of the file system/directory to clone Even if we only consider the common features of traditional Unix file systems, we have to consider: Now the everything else varies from file system to file systems. Now a few things to take into consideration when cloning a file system.Ĭloning would be copying all the directories, files and their contents. Partclone generalises that to a few different file systems. Here we've got two tar working concurrently, so one can read one FS while the other one is busy waiting for the other FS to finish writing.įor ext4 and if you're copying onto a partition that is at least as large as the source, see also clone2fs which works like ntfsclone, that is copies the allocated blocks only and sequentially, so on rotational storage is probably going to be the most efficient. In any case, those will not have the limitation of cp, that does the reads and the writes sequentially. Older versions of pv don't support -a (for average speed reporting), you can use pv -B 200M alone there. Pv will buffer up to 500M of data so can better accommodate fluctuations in reading and writing speeds on the two file systems (though in reality, you'll probably have a disk slower that the other and the OS' write back mechanism will do that buffering as well so it will probably not make much difference). I suggest bsdtar instead of tar because at least on some Linux distributions tar is GNU tar which contrary to bsdtar (from libarchive) doesn't handle preserving extended attributes or ACLs or linux attributes. Try tar, pax, cpio, with something buffering.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |