Find the answer to your Linux question:
Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By devils casper
Hi all, Ubuntu 12.04 desktop 64bit I have 2 HDs, both with Ubuntu12.04 desktop 64bit running, connected in the same PC. HD-1 traditional partitoning HD-2 LVM volume partitioning. On running ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778

    How to read /data


    Hi all,

    Ubuntu 12.04 desktop 64bit

    I have 2 HDs, both with Ubuntu12.04 desktop 64bit running, connected in the same PC.

    HD-1 traditional partitoning
    HD-2 LVM volume partitioning.

    On running the OS on HD-1, HD-2 can't be viewed automatically
    On running the OS on HD-2, HD-1 can be viewed automatically.

    On running the OS on HD-1, I have to mount HD-2 with LVM volume partitions. Then I can view HD-2. But I can't view the content of /data partition.

    # ls -ald /mnt/data
    Code:
    drwxr-xr-x 2 root root 4096 Dec 28 13:11 /mnt/data
    # ls -al /mnt/data
    Code:
    total 8
    drwxr-xr-x  2 root root 4096 Dec 28 13:11 .
    drwxr-xr-x 25 root root 4096 Jan  2 10:11 ..
    However I can read other folders/directories;
    # ls /mnt/
    Code:
    bin   etc         initrd.img.old  media  root     srv  var
    boot  folder      lib             mnt    run      sys  vmlinuz
    data  home        lib64           opt    sbin     tmp  vmlinuz.old
    dev   initrd.img  lost+found      proc   selinux  usr
    I can't resolve why? Pls help. TIA

    B.R.
    satimis

  2. #2
    Just Joined!
    Join Date
    Jun 2012
    Posts
    32
    post the output of the following commands as root:
    Code:
    cat /etc/fstab
    Code:
    fdisk -l

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Partitions of Logical Volume Manager can not be mounted like other ext2/3/4 or vfat/ntfs partitions. First of all, install lvm2 package in Ubuntu. I am not sure if its pre-installed.
    Code:
    sudo apt-get install lvm2
    Execute pvs command and it will list available Volume Group(s). Execute lvmdisplay command to check available Logical Volumes inside Volume Group. Execute mount command to mount Logical Volume after that.

    In my test machine, pvs command lists VolGroup01 and lvmdisplay /dev/VolGroup01 lists /dev/VolGroup01/LogVol00.
    Execute mount command to mount Logical Volume
    Code:
    sudo mkdir /media/data
    sudo mount /dev/VolGroup01/LogVol00  /media/data
    ls /media/data
    mount /
    Last edited by devils casper; 01-02-2013 at 07:27 AM.
    kareempharmacist likes this.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #4
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778
    Quote Originally Posted by devils casper View Post
    Partitions of Logical Volume Manager can not be mounted like other ext2/3/4 or vfat/ntfs partitions. First of all, install lvm2 package in Ubuntu. I am not sure if its pre-installed.
    Code:
    sudo apt-get install lvm2
    Execute pvs command and it will list available Volume Group(s). Execute lvmdisplay command to check available Logical Volumes inside Volume Group. Execute mount command to mount Logical Volume after that.

    In my test machine, pvs command lists VolGroup01 and lvmdisplay /dev/VolGroup01 lists /dev/VolGroup01/LogVol00.
    Execute mount command to mount Logical Volume
    Code:
    sudo mkdir /media/data
    sudo mount /dev/VolGroup01/LogVol00  /media/data
    ls /media/data
    mount /
    lvm2 already installed.


    Performed following steps;

    $ sudo mkdir /media/data
    [sudo] password for satimis:

    $ sudo -i
    # pvs
    Code:
      PV         VG      Fmt  Attr PSize   PFree
      /dev/sdb1          lvm2 a-   243.00m 243.00m
      /dev/sdb5  LVM1.5D lvm2 a-     1.36t      0
    # lvdisplay /dev/LVM1.5D | grep 'LV Name'
    Code:
      LV Name                /dev/LVM1.5D/root
      LV Name                /dev/LVM1.5D/swap
      LV Name                /dev/LVM1.5D/data
    # mount /dev/LVM1.5D/data /media/data
    # ls /media/data/
    Code:
    lost+found  OVA  Satimis_Document  VirtualBox  VirtualBox VMs
    I got it done. Thanks.

    Previously I made a mistake running;
    $ sudo mount /dev/LVM1.5D/data /mnt
    No complaint.

    $ ls -al /mnt
    No printout

    Now I found;
    # ls /mnt/
    Code:
    remoteserver
    # ls -al /mnt/remoteserver/
    Code:
    total 8
    drwxr-xr-x 2 satimis root 4096 Sep 21  2011 .
    drwxr-xr-x 3 root    root 4096 Sep 21  2011 ..
    An empty directory. I have no idea what is it?

    Regards
    satimis
    Last edited by satimis; 01-02-2013 at 11:39 AM.

Posting Permissions

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