[dundee] Image hard drive to file

Andrew Clayton andrew at digital-domain.net
Sun Feb 24 23:40:00 GMT 2008


On Sun, 24 Feb 2008 22:55:52 +0000 (GMT), Lee Hughes wrote:

> you cant image a filesystem while it's mounted.
> 
> either unmount it, or boot from a live disc, and do what you will to
> it from there!
> 

Works fine on a mounted fs.

# dd if=/dev/sda1 of=boot.img
48132+0 records in
48132+0 records out
24643584 bytes (25 MB) copied, 0.580475 s, 42.5 MB/s
# file boot.img
boot.img: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
# mount -o loop boot.img /mnt/disk
# ls -l /mnt/disk/
total 14343
-rw-r--r-- 1 root   root     79593 2008-01-21 19:30 config-2.6.23.14-115.fc8
-rw-r--r-- 1 root   root     79661 2008-02-10 22:57 config-2.6.23.15-137.fc8
drwxr-xr-x 2 root   root      1024 2008-02-16 14:00 grub
-rw------- 1 root   root   3030991 2008-02-07 20:08 initrd-2.6.23.14-115.fc8.img
-rw------- 1 root   root   1916928 2008-02-12 18:34 initrd-2.6.23.15-137.fc8.img
-rw-r--r-- 1 andrew andrew     543 2003-11-22 12:42 kernel.h
drwx------ 2 andrew andrew   12288 2003-11-21 22:37 lost+found
-rw-r--r-- 1 root   root    851712 2008-01-21 19:30 System.map-2.6.23.14-115.fc8
-rw-r--r-- 1 root   root    852777 2008-02-10 22:57 System.map-2.6.23.15-137.fc8
-rw-r--r-- 1 root   root   1979776 2008-01-21 19:30 vmlinuz-2.6.23.14-115.fc8
-rw-r--r-- 1 root   root   1982944 2008-02-10 22:57 vmlinuz-2.6.23.15-137.fc8
-rw-r----- 1 root   root   1913880 2008-02-11 19:50 vmlinuz-2.6.24.2
-rw-r----- 1 root   root   1906012 2008-02-16 13:59 vmlinuz-2.6.25-rc2

From dmesg

kjournald starting.  Commit interval 5 seconds
EXT3 FS on loop0, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.


Andrew



More information about the dundee mailing list