Code: Select all
resize2fs -p /dev/sda2 3891MCode: Select all
resize2fs -p /dev/sda2Code: Select all
[root@box]# dd bs=1M count=3850 if=/dev/zero of=4Grpi.img
3850+0 records in
3850+0 records out
4037017600 bytes (4.0 GB) copied, 80.3155 seconds, 50.3 MB/s
[root@box]# ls -l 4Grpi.img
-rw-r--r-- 1 root root 4037017600 Sep 14 13:36 4Grpi.imgCode: Select all
[root@box]# losetup /dev/loop0 4Grpi.img
[root@box]# losetup /dev/loop0
/dev/loop0: [fd00]:1737392 (4Grpi.img)Code: Select all
[root@box]# dd bs=1024 if=/dev/sda of=/dev/loop0
dd: writing `/dev/loop0': No space left on device
3942401+0 records in
3942400+0 records out
4037017600 bytes (4.0 GB) copied, 313.95 seconds, 12.9 MB/sThe problem with this step is that we expect it to end with the "no space" error, because the new device is smaller than the old one. So it is hard to tell whether the important data has fitted or not.tward800 wrote:[root@box]# dd bs=1024 if=/dev/sda of=/dev/loop0
dd: writing `/dev/loop0': No space left on device
3942401+0 records in
3942400+0 records out
4037017600 bytes (4.0 GB) copied, 313.95 seconds, 12.9 MB/s