Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    mount loop device ?

    This is my first post here and i hope you guys can help me out. I'm following instructions in this link boink wiki / LinuxP2V and i'm hitting a major road bump. All i'm trying to do is to add BusLogic support to initrd image so kernel won't panic when i boot VM.

    Here is the error message that i'm getting:
    cd /boot
    gzip -dc initrd-2.4.20-8.img > /tmp/initrd.ext2
    mkdir /mnt/initrd
    mount -o loop /tmp/initrd.ext2 /mnt/initrd
    mount: you must specify the filesystem type
    I tried to add -t ext3 and -t ext2 and that didn't work. /dev/loop0 > 7 exist and lsmod lists loop as a module.
    Any ideas?

    Thanks in advanc

  2. #2
    Read the man pages!

    man mount
    man initrd
    less /usr/src/linux/Documentation/initrd.txt
    Mount doesn't have a "-o loop" option. You should probably just try "mount" without extra options (but with device and directory of course). If that doesn't work try

    mount -t ramfs /tmp/initrd.ext2 /mnt/initrd
    Otherwise RTFM

  3. #3
    Linux Enthusiast
    Join Date
    Apr 2004
    That error is telling you it doesn't recognise the image type. What happens when you run 'file' against your image?
    chris@angua:~/dev/scratch$ file test.img
    test.img: Linux rev 1.0 ext2 filesystem data
    man mount
    One further possible type is a mount via the loop device. For example,
    the command

    mount /tmp/fdimage /mnt -t msdos -o loop=/dev/loop3,blocksize=1024
    Perhaps not every version of mount supports the loop option, but mine certainly does and I don't think I'm in the minority. Also, I'd expect the error for an unknown option to be different.

    chris@angua:~/dev/scratch$ sudo mount -o loop,steve test.img tmp/
    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
    Note that the steve option is the invalid one here, loop works by itself.
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  4. $spacer_open
  5. #4
    I apologize, I didn't see 'THE LOOP DEVICE' section towards the bottom of the man page myself. I sort of get this steam buildup in my head whenever someone asks a good question like this. I have personally been tied up with other things (besides the forums) and I tend to be short, because I cannot spend the time I need/wish to on a good problem like this.

    So anyway I think you are trying to access the file system inside your initrd image. This is my first real crack at this (I use a monolithic kernel). You don't actually mount this file if you want to modify it. Use this command line instead to extract its contents into the current directory (so use a new/tmp one):

    gzip -dc ../initrd.gz |cpio -id
    More information can be found at : Modifying initrd image

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts