LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2009, 03:08 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Rep: Reputation: 55
mounting a loop device


Hi all..

I have following loopback devices, all partitioned with ext2 file system
Iam getting a problem while mounting these..
loop0p1 : 0 195294 /dev/loop0 19
loop0p5 : 0 292960 /dev/loop0 195360
loop0p6 : 0 488160 /dev/loop0 488352

$ sudo mount -o loop -t ext2 /dev/mapper/loop0p1 /mnt/mount1

worked fine

$ sudo mount -o loop -t ext2 /dev/mapper/loop0p5 /mnt/mount2
mount: wrong fs type, bad option, bad superblock on /dev/loop2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

This is the error I am getting ...

Output of dmesg | tail is

Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.8
fuse init (API version 7.9)
set status page addr 0x00033000
VFS: Can't find an ext2 filesystem on dev loop2.
VFS: Can't find an ext2 filesystem on dev loop2.
VFS: Can't find an ext2 filesystem on dev loop2.
VFS: Can't find an ext2 filesystem on dev loop2.
VFS: Can't find an ext2 filesystem on dev loop1.
VFS: Can't find an ext2 filesystem on dev loop2.


Please help me regarding this....
Thanks in advance...

Last edited by vinaytp; 10-05-2009 at 03:30 AM.
 
Old 10-05-2009, 03:30 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by vinaytp View Post
$ sudo mount -o loop -t ext2 /dev/mapper/loop0p5 /mnt/mount2
mount: wrong fs type, bad option, bad superblock on /dev/loop2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

This is the error I am getting ...

Please help me regarding this....
Thanks in advance...
What do you get from doing a 'dmesg | tail' right after that?

Most likely there is some problem with the filesystem on that device.

Try running fsck.ext2 on it also.
 
Old 10-05-2009, 03:35 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by foodown View Post
What do you get from doing a 'dmesg | tail' right after that?
.
Output of fsck.ext2 loop0p5 is

e2fsck 1.40.8 (13-Mar-2008)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open loop0p5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Then how to mount this loop device..Please suggest me....
 
Old 10-05-2009, 10:47 AM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by vinaytp View Post
Output of fsck.ext2 loop0p5 is

e2fsck 1.40.8 (13-Mar-2008)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open loop0p5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Then how to mount this loop device..Please suggest me....
The problem is just what the error message says -- the system is not detecting the storage type you're specifying to it. It isn't ext2. Do this to find out what it is:

Code:
# fdisk -l
 
Old 10-05-2009, 11:15 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Use the "-o loop" option when mounting a file image. Once a loop device is attached use the loop device as a disk device.

Here is how you could mount the first partition from a disk image:
sudo /sbin/losetup -fs -o $((63*512)) hdimage.img
sudo mount -t ext2 /dev/loop0 /mnt

You can use "sudo /sbin/fdisk -lu <dev or file>" to list the start of partitions in 512 byte blocks. If you have a disk where the partition table is damaged, the first partition will probably start on block 63 or block 2048. The later I've seen on vista laptops.

Last edited by jschiwal; 10-05-2009 at 11:22 AM.
 
Old 10-05-2009, 11:59 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
vinaytp,

Are you mounting a CD/DVD image formatted in ext2? it appears not. You could be mounting an external memory card, stick or device via bluetooth. There are cases that recent memory devices (especially those for cellphones) bought over the counter are designed to defy linux formats. Caveat. I have come across this problem myself, and I found out that there are many of us.

Your demsg | tail report explains just what is wrong: it is your device having problem or that it was not properly formatted. Try reformatting it to FAT16, and use -t vfat you might be able to loop it.

If you are mounting an external hard drive partition there is no need to loop it, just plainly mount it.

If you are mounting a cellphone seated memory there is less chance you can loop it. But you may succeed using gnokii, it is downloadable from here.

Hope this helps.

Good luck.

Last edited by malekmustaq; 10-05-2009 at 12:08 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop device lawrence_lee_lee Linux - Software 1 06-17-2008 02:20 AM
Gentoo. Problems with the loop device when mounting an iso file Snerkel Linux - Software 4 11-26-2004 03:34 PM
un/mounting loop devices box_l Linux - Software 4 08-05-2004 09:03 AM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 09:24 PM
Problem mounting CD image (no loop device)... Slayer Linux - General 1 10-05-2003 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration