I'd say it's a viable approach, not very fast I presume, but using just the shell, why not. Although I'm not sure if bitcopy of the first partition will be enough (I tend to believe it will not).
I'm used to do these things using dd
, e.g.
dd if=/dev/sdb of=/home/user/ISOs/macOS.img bs=512
which will make a bitcopy of the whole device, including MBR, partition layout and all partitions. Trouble is, you'll have to dd it back to a device of the same size (or bigger), but unless that's a problem, it should work.
There are some more sophisticated tools for cloning drives, though. gnome-disks
have an option for making a drive image, clonezilla
and partimage
are others dedicated for this task.
dd
,pv
, or even justcp
.dd
respects the blocksize, but that's about the only advantage. – dirkt Apr 28 '17 at 06:20