Quote:
Originally Posted by schneidz
i didnt even know gzip could write to block devices... can you do the same thing with cat ?
|
I've used gzip/gunzip for partition backups on my laptop. Haven't used cat before for this purpose so I tried it in a virtual machine, it seems to work...
Code:
umount /dev/sda2
cat /dev/sda2 > sda2.cat.img #cat image
gzip -1 < sda2.cat.img > sda2.cat.gz #cat image, gzipped, fast compression
gzip -1 < /dev/sda2 > sda2.gz #gzip image
mount sda2.cat.img /mnt/tmp #mount img as a loop device
ls /mnt/tmp #files should be there
umount /mnt/tmp
... #mount /dev/sda2, delete some files then unmount
cat sda2.cat.img > /dev/sda2 #restore from cat image
mount /dev/sda2 /mnt/tmp #mount /dev/sda2, files seem to have been restored
...but when I ran a diff on the 2 gzipped files they were different. May be I'm doing it wrong or missing something, not sure I'll try it on my laptop's partitions