hi: Is there mothod to look into a image file ? How can I know its filesystem? I have mounted my fd0 to /mnt with -t tmpfs ,but I find nothing under /mnt.How can I touch the files in image? thanks!
On Sun, Feb 3, 2013 at 2:03 AM, horseriver <horserivers@gmail.com> wrote:
hi:
Is there mothod to look into a image file ? How can I know its filesystem?
I have mounted my fd0 to /mnt with -t tmpfs ,but I find nothing under /mnt.How can I touch the files in image?
I think you need to mount it as loopback device http://www.andremiller.net/content/mounting-hard-disk-image-including-partit...
thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thank you Warm Regards Anuz
On 02/03/2013 03:12 PM, Anuz Pratap Singh Tomar wrote:
On Sun, Feb 3, 2013 at 2:03 AM, horseriver <horserivers@gmail.com <mailto:horserivers@gmail.com>> wrote:
hi:
Is there mothod to look into a image file ? How can I know its filesystem?
I have mounted my fd0 to /mnt with -t tmpfs ,but I find nothing under /mnt.How can I touch the files in image?
I think you need to mount it as loopback device http://www.andremiller.net/content/mounting-hard-disk-image-including-partit...
thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org <mailto:Kernelnewbies@kernelnewbies.org> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thank you Warm Regards Anuz
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi, in case of image with multiple partitions, easier to use kpartx, then get the offsets with parted: http://ppadala.net/blog/2010/09/kpartx-to-mount-vm-disk-images/ of course with image with one partition, it doesn't matter -- br, Zoltan Gyarmati mail: mr.zoltan.gyarmati@gmail.com freenode nick: zgyarmati
Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com> wrote:
Hi,
in case of image with multiple partitions, easier to use kpartx, then get the offsets with parted: http://ppadala.net/blog/2010/09/kpartx-to-mount-vm-disk-images/
of course with image with one partition, it doesn't matter
I think you meant an image of a drive with no partitions: Ie. mkfs /dev/sdb. Create a filesystem on the entire disk, there is no offset and no partitions (the entire disk is the filesystem, no mbr or gpt). mkfs /dev/sdb1. Create a filesystem on the first partition, there is an offset even if it is the only partition. You examine the mbr or gpt to determine the offset. Or possibly you meant an image of a partition: dd if=/dev/sdb1 of=image_file. Create the image of a partition, no offset needed for loopback mount. Greg -- Sent from my Android phone with K-9 Mail. Please excuse my brevity.
On 02/04/2013 03:03 PM, Greg Freemyer wrote:
Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com> wrote:
Hi,
in case of image with multiple partitions, easier to use kpartx, then get the offsets with parted: http://ppadala.net/blog/2010/09/kpartx-to-mount-vm-disk-images/
of course with image with one partition, it doesn't matter I think you meant an image of a drive with no partitions:
Ie. mkfs /dev/sdb. Create a filesystem on the entire disk, there is no offset and no partitions (the entire disk is the filesystem, no mbr or gpt).
mkfs /dev/sdb1. Create a filesystem on the first partition, there is an offset even if it is the only partition. You examine the mbr or gpt to determine the offset.
Or possibly you meant an image of a partition:
dd if=/dev/sdb1 of=image_file. Create the image of a partition, no offset needed for loopback mount.
Greg
Indeed! I was not accurate enough, thx for the comment. -- br, Zoltan Gyarmati mail: mr.zoltan.gyarmati@gmail.com freenode nick: zgyarmati
hi:) I have a image file ,after I input this command: ****** sh> losetup /dev/loop0 xx.img sh> mount -t tmpfs /dev/loop0 /mnt ****** I find no content under /mnt ,But this image file contains a bootloader. What is the reason ? How can I check out the file tree structure of this image ? thanks!
On Tue, Feb 5, 2013 at 12:46 AM, horseriver <horserivers@gmail.com> wrote:
hi:)
I have a image file ,after I input this command:
****** sh> losetup /dev/loop0 xx.img sh> mount -t tmpfs /dev/loop0 /mnt
******
I find no content under /mnt ,But this image file contains a bootloader. What is the reason ? How can I check out the file tree structure of this image ?
Determine the file type of your image file. I suspect you are trying to look into the initrd images. These image files are compressed gzip images. You can try extracting the image file then examine it's content. gunzip -c <path_to_image_file> | cpio -id The above command would extract the content of the image file in the current directory. Hope this solves your problem. thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
hi: It is not a cpio archive , so that command can not work . its file system type is tmpfs. thanks!
On Tue, 05 Feb 2013 04:59:42 +0800, horseriver said:
hi:
It is not a cpio archive , so that command can not work .
its file system type is tmpfs.
Umm. No. It's not tmpfs. tmpfs is a specific ram/swap based filesystem - basically, take enough 4K pages for the size= parameter and do it in memory. Major user-visible difference from the older 'ramfs' is that tmpfs pages can move to swap space, and ramfs pages are nailed down in RAM. mount -t tmpfs /dev/loop0 /mnt This never actually looks at /dev/loop0 *at all*. You could even say this: mount -t tmpfs none /mnt and it would work just fine. Try leaving the '-t tmpfs' off entirely and let the mount command figure out what type it is, and see if that works any better for you.
participants (6)
-
Anuz Pratap Singh Tomar -
Greg Freemyer -
horseriver -
Valdis.Kletnieks@vt.edu -
Vineet Agarwal -
Zoltan Gyarmati