Mounting RAW files that have LVM partitions inside them Yaa

    Table of contents
    No headers

    In Progress...

    kpartx -a [rawfile]

    ls -l /dev/mapper

    loop2p1 and loop2p2

    pvs

    VolGroup's conflicting, rename conflicting VolGroup !! Do this on a non-important system.  My VolGroup00 went totally wonky after this and I needed to reboot.  VolGroup00, even tho I renamed the right one, got stuck partially thinking it was the other VolGroup00 -- this caused great problems when I went and mounted the LogVol00.  I ended up with my local LogVol00 mounted.  This is a very good reason why you should NOT use the default VolGroup00 and LogVol00 for any of your servers.  Time to name them all differently.  This appears to be a bug with the vgrename program, it screws up the names of the /dev/VolGroup00 file.  You can rename it to the right thing !!

    vgrename qG5ZiR-NHQH-S3ge-xMo6-2xwZ-dl98-egdzuX newvgname

    lvs

    If the logical volume is not active:

    lvchange -a y vg/lv

    mount -o ro -t ext3 /dev/newvgname/logvol00 logvolmnt

    Notice I didn't mount the raw file in RW.  This is just because I almost nuked myself with the volume group renaming issue I talked about.  Might as well not mount that partion RW just so you can screw it up.

     

    NTFS:

    Your ntfs lv is a disk image just like your linux lv's that have lvm inside them.  You'll need to kpartx them:

    kpartx -a [dev]

    you'll end up with /dev/mapper/%partname%1 and %partname%2, etc for the number of partitions on that disk.  If you have a full disk, windows always loves to leave some space at the end so you'll want to hit partition 1

    If you're using CentOS 5.4 you already have fuse and the fuse kernel modules.  You'll also need fuse itself (installable from the CentOS Base) and then you'll need the ntfs-3g module.  Nab the latter from RPMForge (and always beware having RPMForge enabled on a system if you're not careful with it because you'll end up with a lot of new stuff installed that you probably don't want on a production server).

    With that stuff all set:

    mount -t ntfs-3g /dev/mapper/%partname%1 /%yourmountpoint%

    Tag page (Edit tags)
    • No tags
    You must login to post a comment.