4 ms·
Please show me how you cp a raw device without the concept of files. I’d love to learn. $ cp /dev/nvme0n1p1 /mnt/my-special-backup ?
by mrcode007 2y ago
Please show me how you cp a raw device without the concept of files. I’d love to learn.
$ cp /dev/nvme0n1p1 /mnt/my-special-backup
?
- jeffbee 2y agoYes
- mrcode007 2y agoHa. Today I learned. Is this a portable approach across macOS, Linux and BSD family ?
- chipdart 2y ago> Is this a portable approach across macOS, Linux and BSD family ? I think that feature relies in the concept of a device file, which is a direct reflection of the UNIX trait of everything being a file. https://en.wikipedia.org/wiki/Device_file https://en.wikipedia.org/wiki/Device_file
- userbinator 2y agoA device is a file. That's the power and elegance of Unix-like systems.
- immibis 2y agoThe correct abstraction is that a file is a device. A file is a section of a hard disk which behaves like a whole disk. It also happens to be expandable. cp's default behaviour for device files also happens to be very stupid.
- m463 2y agodd can copy block by block from one block device to another ddrescue can do the same, but will handle errors better e2image understands ext2/3/4 filesystems and can copy only the blocks in use, which can really help (though don't know how it works if it encounters an error)