Hallo every body!!!
Well there is where i'm in troubel...
The begin:
"I read Kyle Rakin's colum about this moths Lightning hacks strike twice, my interes was focus on the dd image over ssh" before this I've heard about dd but I didn't know how wonderfull (and powerfull) it is.
Next step-the do:
I start make a hole dd over my disk to a image file...
dd if=/dev/sda of=/media/paseo/imagen/imagen.img
this works fine but now...
The problem:
The idea is that I want to mount this image...exactly is the root partition for later recover some files for example--like
mount -t ext3 -o loop /media/paseo/imagen/imagen.img /media/net
thet output of the error msg
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
En algunos casos se encuentra información en syslog, pruebe
dmesg | tail o algo parecido
this is my dmesg |tail
[16563.291016] mtrr: no more MTRRs available
[25143.183670] VFS: Can't find ext3 filesystem on dev loop0.
[27605.632847] VFS: Can't find ext3 filesystem on dev loop0.
[27609.437021] VFS: Can't find ext3 filesystem on dev loop0.
[36690.146233] VFS: Can't find ext3 filesystem on dev loop0.
so I start searching in the inet
this point me at first time to
http://www.linuxquestions.org/questions/linux-general-1/restore-files-from-dd-image-618939/
where I extract that I have to type
fdisk -l -u /media/paseo/imagen/imagen.img
the output of this is
Debe establecer cilindros.
Puede efectuar esta operación desde el menú de funciones adicionales.
Disco /media/paseo/imagen/imagen.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, 0 sectores en total
Units = sectores of 1 * 512 = 512 bytes
Disk identifier: 0xb7d8b185
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/media/paseo/imagen/imagen.img1 63 2152709 1076323+ 82 Linux swap / Solaris
/media/paseo/imagen/imagen.img2 2152710 15759764 6803527+ 83 Linux
from this it make me clear that there was two partitions....
AND I want to mount the second yes... my file system...
in this forum the guy Halgeir point me to ---this page http://edseek.com/~jasonb/articles/linux_loopback.html
where I read on....
and at the point where it gets interest for me (at the last page I told about) with the title "Mounting by First Extracting the Partition"
I make exact what this guy tell about (with my image paramaters) and it don't function...
At the end I make a image (alone) of my root partition /dev/sda2 and have after it mounted whithout any problem...!!!
So my question is how can I extract with dd a partition (the exactly parameters or funtions), from a hole image of a disk!!!
Thanks at all.
__________________________
Subscribe now!
The Latest
Newsletter
Tech Tip Videos
- Nov-19-09
- Nov-04-09
Recently Popular
From the Magazine
December 2009, #188
If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.
Delicious
Digg
StumbleUpon
Reddit
Facebook








Do not work
On June 29th, 2009 macaal says:
Hy!
First thanks for your fast reply, Mitch Frazier...
But I've to inform that it don't work!!!
#mount like you tell me with out to extract
mount -o loop,ro,offset=$((2152710*512)) /media/paseo/imagen/imagen.img /media/net/
#The output
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
En algunos casos se encuentra información en syslog, pruebe
dmesg | tail o algo parecido
#The dmesg |tail
dmesg |tail
[15277.904921] EXT3-fs: write access unavailable, cannot proceed.
[15285.188111] EXT3-fs: INFO: recovery required on readonly filesystem.
[15285.188111] EXT3-fs: write access unavailable, cannot proceed.
[15643.599213] VFS: Can't find ext3 filesystem on dev loop0.
[15746.863089] VFS: Can't find ext3 filesystem on dev loop0.
[15761.026594] VFS: Can't find ext3 filesystem on dev loop0.
[15803.577323] VFS: Can't find ext3 filesystem on dev loop0.
[15864.643090] VFS: Can't find ext3 filesystem on dev loop0.
[15947.770446] EXT3-fs: INFO: recovery required on readonly filesystem.
[15947.770446] EXT3-fs: write access unavailable, cannot proceed.
#and doing the extract process
dd if=/media/paseo/imagen/imagen.img of=/media/paseo/imagen/newimagen.img bs=512 skip=2152710 count=6803527
#give me this result when I try to mount it...
mount -o loop /media/paseo/imagen/newimagen.img /media/net/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
En algunos casos se encuentra información en syslog, pruebe
dmesg | tail o algo parecido
#the dmesg of this is...
dmesg |tail
[16232.413789] EXT3-fs: INFO: recovery required on readonly filesystem.
[16232.413789] EXT3-fs: write access unavailable, cannot proceed.
[16416.988757] kjournald starting. Commit interval 5 seconds
[16416.988757] EXT3-fs warning: mounting fs with errors, running e2fsck is recommended
[16416.988757] EXT3 FS on loop0, internal journal
[16416.988757] EXT3-fs: mounted filesystem with ordered data mode.
[16473.681905] attempt to access beyond end of device
[16473.681929] loop0: rw=0, want=6295576, limit=6235897
[16473.681943] JBD: IO error reading journal superblock
[16473.681957] EXT3-fs: error loading journal.
#So I do some research on my own and find out that the extracted image is in size smaller than that, that I make by hand...
#I clear up
dd if=/dev/sda2 of=/media/paseo/imagen/test.img
#The size of this image is...
du -s /media/paseo/imagen/test.img
4194304 /media/paseo/imagen/test.img
#4Gb
#And the size of the extracted image is...
du -s /media/paseo/imagen/newimagen.img
3117952 /media/paseo/imagen/newimagen.img
#I think here is the point of the problem
#The calculation is wrong so I get a wrong size of the image in the two cases (extract and mount)...
#If some one can find out the right calculation... would be nice...and think would be work...!!!
Thanks at all....!!!
Try Using Parted
On June 29th, 2009 Mitch Frazier says:
Try using parted rather than fdisk to display the offsets and sizes of the partitions. Set the units to bytes and then do a print. Take the byte values and divide them by 512, check to see if they match the values that fdisk is telling you.
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
Use dd with an offset and count
On June 28th, 2009 Mitch Frazier says:
This should extract the partition from the disk image:
Then you should be able to mount it with:
You should also be able to mount it without extracting it with:
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
Post new comment