linux - Problem mounting LVM in ubuntu

27
2013-07
  • Ivo Trompert

    A few months ago I have setup a server with three hard disks. The partition mapping the disks as follows:

    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x7ca36fee
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       12158    97659103+  83  Linux
    /dev/sda2           12159       13131     7815622+  82  Linux swap / Solaris
    /dev/sda3           13132      121601   871285275    5  Extended
    /dev/sda5           13132      121601   871285243+  8e  Linux LVM
    
    Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000160d1
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1      121601   976760001    5  Extended
    /dev/sdc5               1      121601   976759969+  8e  Linux LVM
    
    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0008d423
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1      121601   976760001    5  Extended
    /dev/sdb5               1      121601   976759969+  8e  Linux LVM
    

    As you can see I have created a Linux LVM file system. This are the information of the LVM Logical volume:

    --- Logical volume ---
    LV Name                /dev/gegevens/Data
    VG Name                gegevens
    LV UUID                XsddGq-i3wO-HjTg-Lafe-TSF3-28kr-FGYhRd
    LV Write Access        read/write
    LV Status              available
    # open                 1
    LV Size                2.63 TB
    Current LE             689648
    Segments               3
    Allocation             inherit
    Read ahead sectors     auto
    - currently set to     256
    Block device           252:0
    

    Now I have the following problem the LVM file system don't mount properly.

    If I open the mount point I see only a few files of the LVM disk. If I want to unmount the disk I get the following error:

    umount /data/
    umount: /data/: not mounted
    

    If I want to mount the volume I get the following error:

    mount -a
    mount: /dev/mapper/gegevens-Data already mounted or /data busy
    

    Wat is the problem here?

    Thank you,

    Ivo Trompert

  • Answers
  • bclermont

    Please paste the output of the following commands:

    mount
    

    as root:

    lsof | grep gegevens-Data
    

    as root again:

    lsof | grep /data
    
  • Gilles

    Given the messages /dev/mapper/gegevens-Data already mounted or /data busy and umount: /data/: not mounted, it looks like your gegevens-Data volume is already mounted on some other directory. You can confirm that with df /dev/mapper/gegevens-Data or grep /dev/mapper/gegevens-Data /proc/mounts.

    If your next question is why it is mounted: either you did it manually and forgot, or there is an entry for /dev/mapper/gegevens-Data or UUID=XsddGq-i3wO-HjTg-Lafe-TSF3-28kr-FGYhRd in /etc/fstab.

    You may be interested in the command mount --move /some/where /data to change the point where a filesystem is mounted without having to unmount it.

    If I open the mount point I see only a few files of the LVM disk.

    Actually these files are probably files that you tried to write to the LVM disk when it wasn't mounted on /data, so move them to the LVM disk before mounting it where you want it.

  • Ignacio Vazquez-Abrams

    An application has files open under /data, which is blocking the mount operation. Use lsof or fuser to verify.

  • MA1

    Successfully mounted my LVM partitions using steps mentioned in link below

    Mounting LVM Disk using Ubuntu livecd

    See if it can help you?


  • Related Question

    windows xp - Cannot boot XP, after installing Ubuntu 9.10
  • Paikkos

    I had 2 partitions with 2 XP. I selected the 1st partition, formatted it, and installed Ubuntu 9.10 on it.

    Now I can't boot into XP cz is showing me the XP loader of the XP that I deleted... I tried fixmbr and fixboot but with no effect.

    In the beginning XP couldn't boot, but at least I could browse the folders from Linux. Now in the Disk Utility it's written unrecognised, unknown or unused.

    Screenshots:

    enter image description here

    enter image description here

    Here it is:

    ~# fdisk -l
    
    Disk /dev/sda: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xb7e61057
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       22508   180795478+  83  Linux
    /dev/sda2           22509       30400    63392490    f  W95 Ext'd (LBA)
    /dev/sda5   *       22752       30400    61440592+   7  HPFS/NTFS
    /dev/sda6           22509       22751     1951834+  82  Linux swap / Solaris
    
        ~#
        ~# ntfsfix /dev/sda5
        Mounting volume... $MFT has invalid magic.
        ntfs_mft_load(): Failed.
        Failed to load $MFT: Input/output error.
        Failed to startup volume: Input/output error.
        FAILED
        Attempting to correct errors... $MFT has invalid magic.
        ntfs_mft_load(): Failed.
        Failed to load $MFT: Input/output error.
        FAILED
        Failed to startup volume: Input/output error.
        Volume is corrupt. You should run chkdsk.
    

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Update: after playing with some partition boot CDs:

    root@ubuntu-tower:~# fdisk -l
    
    Disk /dev/sda: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xb7e61057
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       22508   180795478+  83  Linux
    /dev/sda3           22752       30400    61440592+   7  HPFS/NTFS
    

    Here's a screenshot of GParted and Disk Utility:

    enter image description here

    Any ideas?


  • Related Answers
  • Cicik

    I have same problem as you and Partition Table Doctor resolved it. Some time ago in work when WinXP can`t load I use fixmbr and fixboot commands from WinXP recovery console and it works too, here is tutorial

  • mac

    I believe you are right: the problem seems to be due to the XP bootloader "gone with the wind". Does any of these how-to help?