Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Mounting Hard Drive Image Help

  1. #1
    Join Date
    Oct 2010
    Location
    USA
    Posts
    10

    Default Mounting Hard Drive Image Help

    Hello,

    I am not sure where I should have posted this question but here it is any way.

    I am trying to mount a hard drive image I made of my old openSUSE 10.2 x86-64 system (reiserfs). When I try to mount it I get this error:

    sudo mount /dev/mapper/loop0p2 atlasImg
    mount: wrong fs type, bad option, bad superblock on /dev/mapper/loop0p2,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so

    Output from dmesg:

    [ 8551.410398] REISERFS (device dm-2): found reiserfs format "3.6" with standard journal
    [ 8551.410468] REISERFS (device dm-2): using ordered data mode
    [ 8551.410472] reiserfs: using flush barriers
    [ 8551.410705] REISERFS (device dm-2): journal params: device dm-2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [ 8551.411955] REISERFS (device dm-2): checking transaction log (dm-2)
    [ 8551.412080] REISERFS warning (device dm-2): journal-837 _update_journal_header_block: IO error during journal replay
    [ 8551.412088] REISERFS warning (device dm-2): reiserfs-2006 journal_init: Replay Failure, unable to mount
    [ 8551.412395] REISERFS warning (device dm-2): sh-2022 reiserfs_fill_super: unable to initialize journal space

    so I ran a reiserfsck of the image:

    sudo /sbin/reiserfsck --check /dev/mapper/loop0p2
    reiserfsck 3.6.21 (2009 www.namesys.com)
    Will read-only check consistency of the filesystem on /dev/mapper/loop0p2
    Will put log info to 'stdout'

    ###########
    Replaying journal: Done.
    Reiserfs journal '/dev/mapper/loop0p2' in blocks [18..8211]: 0 transactions replayed
    Checking internal tree.. finished
    Comparing bitmaps..finished
    Checking Semantic tree:
    finished
    No corruptions found
    There are on the filesystem:
    Leaves 80016
    Internal nodes 547
    Directories 44574
    Other files 322872
    Data block pointers 8385626 (386230 of them are zero)
    Safe links 0
    ###########

    which says everything is OK. I am not sure where to go from here, so any help or guidance will be appreciated. Thank you in advance.

    Note: Current System is openSUSE 11.3 x86-64
    Image made with ddrescue of entire hard drive
    -3 partitions NTFS, reiserfs, linux-swap
    -can mount NTFS partition
    -sudo /sbin/losetup /dev/loop0 sansDigital/HD-IMG/adsAtlasII092610.img
    -sudo /sbin/kpartx -a /dev/loop0

  2. #2

    Default Re: Mounting Hard Drive Image Help

    Hello adsrc and welcome to the community!

    Quote Originally Posted by adsrc
    I am trying to mount a hard drive image I made of my old openSUSE 10.2 x86-64 system (reiserfs). When I try to mount it I get this error:

    sudo mount /dev/mapper/loop0p2 atlasImg
    mount: wrong fs type, bad option, bad superblock on /dev/mapper/loop0p2,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so

    ...

    which says everything is OK. I am not sure where to go from here, so any help or guidance will be appreciated. Thank you in advance.
    You could try this command:
    Code:
    mount -o loop file.img /mnt
    If it fails it's most likely that the image is compressed.
    It could be one of many compression methods, but I think that gzip is most common.

    And could you tell us with which program and how you made the image?

    Best of luck!
    Where did I put my coffee cup?
    dir -R /home/* | grep "coffee cup"

  3. #3
    Join Date
    Oct 2010
    Location
    USA
    Posts
    10

    Default Re: Mounting Hard Drive Image Help

    Hello Edward_lii,

    Thank you for responding. I do not believe the image is compressed nor do I think "mount -o loop file.img /mnt" will work as the image is of a whole disk and not just a partition ( /dev/sda vs /dev/sda1).

    The program used to make the image was ddrescue using a command like:
    ddrescue -v /dev/sda imagefilename.img logfile.log

    Typically to get to the image you would first setup a loopback device to the whole disk image:
    losetup /dev/loopx imagefilename.img
    where x is the next available loopback device available, if no loopback devices are in use typical loop0 is used.

    You can not mount that loopback device as is because it is of a whole disk and would be like trying to mount /dev/sda.

    To get to the individual partitions kpartx is used:
    kpartx -a /dev/loopx
    where x is the loopback device you setup using losetup. This will create loopback devices to the individual partitions in the whole disk image within the /dev/mapper directory in the form of loopxpy where where x is the loopback device you setup using losetup and y is the partition number.

    For my setup in specific from the /mnt directory:
    sudo /sbin/losetup /dev/loop0 sansDigital/HD-IMG/adsAtlasII092610.img
    sudo /sbin/kpartx -a /dev/loop0
    ls /dev/mapper/
    control loop0p1 loop0p2 loop0p3

    loop0p1 was my sda1 in my old system (NTFS)
    loop0p2 was my sda2 (reiserfs)
    loop0p3 was my sda3 (linux swap)

  4. #4

    Default Re: Mounting Hard Drive Image Help

    Hello adsrc,

    Quote Originally Posted by adsrc
    Hello Edward_lii,

    Thank you for responding. I do not believe the image is compressed nor do I think "mount -o loop file.img /mnt" will work as the image is of a whole disk and not just a partition ( /dev/sda vs /dev/sda1).

    The program used to make the image was ddrescue using a command like:
    ddrescue -v /dev/sda imagefilename.img logfile.log

    Typically to get to the image you would first setup a loopback device to the whole disk image:
    losetup /dev/loopx imagefilename.img
    where x is the next available loopback device available, if no loopback devices are in use typical loop0 is used.

    You can not mount that loopback device as is because it is of a whole disk and would be like trying to mount /dev/sda.

    To get to the individual partitions kpartx is used:
    kpartx -a /dev/loopx
    where x is the loopback device you setup using losetup. This will create loopback devices to the individual partitions in the whole disk image within the /dev/mapper directory in the form of loopxpy where where x is the loopback device you setup using losetup and y is the partition number.

    For my setup in specific from the /mnt directory:
    sudo /sbin/losetup /dev/loop0 sansDigital/HD-IMG/adsAtlasII092610.img
    sudo /sbin/kpartx -a /dev/loop0
    ls /dev/mapper/
    control loop0p1 loop0p2 loop0p3

    loop0p1 was my sda1 in my old system (NTFS)
    loop0p2 was my sda2 (reiserfs)
    loop0p3 was my sda3 (linux swap)
    I wasn't aware of that, thanks for explaining.

    Anyway, back to the problem.
    You could try this command:
    Code:
    mount -t reiser4 /dev/<DEVICE> /mnt/
    Not sure about the version, I don't use reiserfs myself.

    Another reason for this problem could be that reiserfs isn't supported in your kernel.
    To check this run this command:
    Code:
    cat /proc/filesystems
    Best of luck!
    Where did I put my coffee cup?
    dir -R /home/* | grep "coffee cup"

  5. #5
    Join Date
    Oct 2010
    Location
    USA
    Posts
    10

    Default Re: Mounting Hard Drive Image Help

    Hello Edward_lii,

    Thank you again for your suggestions. I tried to mount using the "-t reiser4" switch:

    sudo mount -t reiser4 /dev/mapper/loop0p2 atlasImg
    mount: unknown filesystem type 'reiser4'

    using "-t reiserfs" produces the usual:

    sudo mount -t reiserfs /dev/mapper/loop0p2 atlasImg
    mount: wrong fs type, bad option, bad superblock on /dev/mapper/loop0p2,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so

    My system is formatted using reiserfs:

    cat /proc/filesystems
    nodev sysfs
    nodev rootfs
    nodev bdev
    nodev proc
    nodev cgroup
    nodev cpuset
    nodev tmpfs
    nodev devtmpfs
    nodev debugfs
    nodev securityfs
    nodev sockfs
    nodev pipefs
    nodev anon_inodefs
    nodev devpts
    ext3
    ext2
    nodev ramfs
    nodev hugetlbfs
    iso9660
    nodev mqueue
    nodev usbfs
    reiserfs
    nodev fuse
    fuseblk
    nodev fusectl

    I tried to mount this image using Knoppix 6.2.1 and it was able to mount so I don't know why I can't mount it from openSUSE 11.3 x86-64. I guess something must be set incorrectly on my system.

  6. #6
    Carlos E. R. NNTP User

    Default Re: Mounting Hard Drive Image Help

    On 2010-10-11 18:06, adsrc wrote:


    > I am trying to mount a hard drive image I made of my old openSUSE 10.2
    > x86-64 system (reiserfs). When I try to mount it I get this error:
    >
    > sudo mount /dev/mapper/loop0p2 atlasImg
    > mount: wrong fs type, bad option, bad superblock on /dev/mapper/loop0p2,
    > missing codepage or helper program, or other error
    > In some cases useful info is found in syslog - try dmesg | tail or so
    >
    > Output from dmesg:
    >
    > [ 8551.410398] REISERFS (device dm-2): found reiserfs format "3.6" with standard journal
    > [ 8551.410468] REISERFS (device dm-2): using ordered data mode
    > [ 8551.410472] reiserfs: using flush barriers
    > [ 8551.410705] REISERFS (device dm-2): journal params: device dm-2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30


    It is really attempting to mount.

    > [ 8551.411955] REISERFS (device dm-2): checking transaction log (dm-2)
    > [ 8551.412080] REISERFS warning (device dm-2): journal-837 _update_journal_header_block: IO error during journal replay


    That's the error. There is a input/output error, which typically would mean the image is read-only.
    To avoid that I would try to mount read-only in the command line - but if the journal is dirty, it
    would not work.

    I could perhaps also point to a read error in the original disk, which might be interfering :-? I
    doubt it, but perhaps.

    > [ 8551.412088] REISERFS warning (device dm-2): reiserfs-2006 journal_init: Replay Failure, unable to mount
    > [ 8551.412395] REISERFS warning (device dm-2): sh-2022 reiserfs_fill_super: unable to initialize journal space
    >
    > so I ran a reiserfsck of the image:


    Not needed, I think.


    > sudo /sbin/reiserfsck --check /dev/mapper/loop0p2
    > reiserfsck 3.6.21 (2009 www.namesys.com)
    > Will read-only check consistency of the filesystem on
    > /dev/mapper/loop0p2
    > Will put log info to 'stdout'


    Read only, it says :-?


    [...]

    I see you got it working with another system. Interesting.


    If the image was indeed read-only, I think I read somewhere that write ops could be redirected to
    somewhere else. I think it is a system used for live systems, no idea if it could be used here.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  7. #7
    Join Date
    Oct 2010
    Location
    USA
    Posts
    10

    Default Re: Mounting Hard Drive Image Help

    Thank you Carlos E. R.

    The drive the image is located on was mounted as read only. Once I mounted the drive as read/write I was able to mount the image. It would be nice to mount the drive with my images as read only to protect myself from, well, myself. If there is a way to mount this image while the disk containing the image is mounted as read only, I would love to find out.

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Mounting Hard Drive Image Help

    You can mount the filesystem R/O to prevent yourself from making changes to it at the filesystem level, but the image file must still be writable for the sake of the journal, as you have seen.

    Anyway, you have a backup of the image, no?

  9. #9
    Join Date
    Oct 2010
    Location
    USA
    Posts
    10

    Default Re: Mounting Hard Drive Image Help

    Yeah, backup of the images, right. That is something I should do. The images are on a RAID 1 array to protect against hard drive failure, but I have no complete backup. I have over 1TBs of images, but that is no excuse as hard drives are cheap.

    Getting back to the idea of having the drive with the images as read only could UnionFS or Aufs be used to redirect writes to a different location or is this asking for trouble.

  10. #10
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Mounting Hard Drive Image Help

    I seem to recall reiserfs allows the journal to be kept somewhere else, but I haven't used it for quite a while now.

    Why not copy the data off reiserfs onto a filesystem that is really R/O like ISO9660?

Page 1 of 3 123 LastLast

Posting Permissions

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