Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# mount -t ext3 -o loop arch-live-usb_201105070115.img /mnt/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
# dmesg | tail
[13986.478722] VFS: Can't find ext3 filesystem on dev loop0.
# losetup -f arch-live-usb_201105070115.img
# losetup -a
/dev/loop0: [0809]:262025 (/home/sense/software/test/arch-live-usb_201105070115.img)
# mount /dev/loop0 /mnt/
mount: you must specify the filesystem type
# mount -t ext3 /dev/loop0 /mnt/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
# dmesg | tail
[13986.478722] VFS: Can't find ext3 filesystem on dev loop0.
thank you.
Click here to see the post LQ members have rated as the most helpful post in this thread.
.img files are often compressed with gzip or cpio or both. To gather a distro into one file needs cpio or tar, cpio being preferred as it offers some compression.
The problem is that the .img files are not images of a partition, but of a whole disk. That means they start with a bootloader and a partition table. You have to find out the offset of the partition and mount it with the offset option of mount.
If you do a
Code:
fdisk -l /path/to/image
it will show you the block-size and the start-block of the partition. You can use that to calculate the offset.
For example, I have an image of a bootable stick with a 4GB FAT32 partition. The output of the fdisk command is
Code:
Disk Stick.img: 3984 MB, 3984588800 bytes
249 heads, 6 sectors/track, 5209 cylinders, total 7782400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004bfaa
Device Boot Start End Blocks Id System
Stick.img1 * 128 8015999 4007936 b W95 FAT32
So I have a block-size of 512 bytes and the start-block is 128. The offset is 512 * 128 = 65536.
So the mount command would be
The problem is that the .img files are not images of a partition, but of a whole disk. That means they start with a bootloader and a partition table. You have to find out the offset of the partition and mount it with the offset option of mount.
If you do a
Code:
fdisk -l /path/to/image
it will show you the block-size and the start-block of the partition. You can use that to calculate the offset.
For example, I have an image of a bootable stick with a 4GB FAT32 partition. The output of the fdisk command is
Code:
Disk Stick.img: 3984 MB, 3984588800 bytes
249 heads, 6 sectors/track, 5209 cylinders, total 7782400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004bfaa
Device Boot Start End Blocks Id System
Stick.img1 * 128 8015999 4007936 b W95 FAT32
So I have a block-size of 512 bytes and the start-block is 128. The offset is 512 * 128 = 65536.
So the mount command would be
Code:
mount -o loop,offset=65536 Stick.img /mnt/tmp
thank you
that is the info on my computer:
# fdisk -l arch-live-usb_201105070115.img
You must set cylinders.
You can do this from the extra functions menu.
Device Boot Start End Blocks Id System
arch-live-usb_201105070115.img1 1 127 295936 83 Linux
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 32, 33) logical=(0, 107, 16)
Partition 1 has different physical/logical endings:
phys=(36, 247, 19) logical=(126, 10, 18)
# mount -o loop,offset=512 arch-live-usb_201105070115.img /mnt
mount: you must specify the filesystem type
# mount -t ext3 -o loop,offset=512 arch-live-usb_201105070115.img /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
# dmesg |tail
VFS: Can't find ext3 filesystem on dev loop0.
You do not know for sure that the partition is formatted as ext3
The partition type of 0x83 just means "linux", and although that can mean ext3, it ain't necessarily so.
Try reading this post by David the H. where he is using the -t auto option to mount, to mount a partition within an image.
thank you very much!
it's work good now
# fdisk -lu arch-live-usb_201105070115.img
You must set cylinders.
You can do this from the extra functions menu.
Disk arch-live-usb_201105070115.img: 0 MB, 0 bytes
248 heads, 19 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xff978785
Device Boot Start End Blocks Id System
arch-live-usb_201105070115.img1 2048 593919 295936 83 Linux
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 32, 33) logical=(0, 107, 16)
Partition 1 has different physical/logical endings:
phys=(36, 247, 19) logical=(126, 10, 18)
# mount -t auto -o loop,offset=$((2048*512)) arch-live-usb_201105070115.img /mnt/
@gopyan
Please do not resurrect necro threads without adding constructive information to thread via posts. If you wish to honor the help then just press 'Did you find this post helpful?' Yesto find the post helpful. Or you can give Rep by pressing the scales icon under the members profile.
The problem is that the .img files are not images of a partition, but of a whole disk. That means they start with a bootloader and a partition table. You have to find out the offset of the partition and mount it with the offset option of mount.
If you do a
Code:
fdisk -l /path/to/image
it will show you the block-size and the start-block of the partition. You can use that to calculate the offset.
For example, I have an image of a bootable stick with a 4GB FAT32 partition. The output of the fdisk command is
Code:
Disk Stick.img: 3984 MB, 3984588800 bytes
249 heads, 6 sectors/track, 5209 cylinders, total 7782400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004bfaa
Device Boot Start End Blocks Id System
Stick.img1 * 128 8015999 4007936 b W95 FAT32
So I have a block-size of 512 bytes and the start-block is 128. The offset is 512 * 128 = 65536.
So the mount command would be
Code:
mount -o loop,offset=65536 Stick.img /mnt/tmp
I just wanted to thank you. It just solved my problem.
Thank you for your welcome.
Yes, I have noticed that but I had to thank him
Thanks
The chances are the poster in question doesn't even post on here any more. So, I'm afraid to say that, like this post, your post added noise, not signal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.