LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting a newly created LVM Group (http://www.linuxquestions.org/questions/linux-newbie-8/mounting-a-newly-created-lvm-group-743355/)

simplified 07-28-2009 08:16 AM

Mounting a newly created LVM Group
 
Hi All

I've been banging my head against the wall with this one...

I've recently rebuilt my server with three HDD's, 1x250GB and 2x1TB drives. What I'm trying to achieve is to have /boot, swap, /var and / mounted on the first drive (no problems there) and then have /home mounted on an LVM of the two 1TB drives, giving me a 2TB /home directory. Herein lies the problem...

I've created a LVM group via system-config-lvm and it all looks good. I've given it the name "DSLVM01" and I can see it through the system-config-lvm GUI no problem at all.

I then run "# fdisk -l" which looks good, here's the output:

Code:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000af342

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          24      192748+  83  Linux
/dev/sda2          29916      30401    3903795  82  Linux swap / Solaris
/dev/sda3          17758      29915    97659135  83  Linux
/dev/sda4              25      17757  142440322+  5  Extended
/dev/sda5              25      17757  142440291  83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00088ea9

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1      121601  976760001  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: 0x000632cb

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1      121601  976760001  8e  Linux LVM

...so I can see that my LVM is created. Now, when I run '# pvs' I get this output:

Code:

  PV        VG      Fmt  Attr PSize  PFree
  /dev/sdb1  DSLVM01 lvm2 a-  931.51G 931.51G
  /dev/sdc1  DSLVM01 lvm2 a-  931.51G 931.51G

Great! I can see my volume group DSLVM01! Now (according to the instructions I've found on the web) I can mount the LVM using the command:

Code:

# mount /dev/DSLVM01 /home
... and here's the problem. I can't seem to find any reference to DSLVM01 at all. So I thought I'd search the filesystem, so I tried:

Code:

# find / -name DSLVM01
/etc/lvm/backup/DSLVM01
#

Now looking in the file /etc/lvm/backup/DSLVM01 in vi I get the following:

Code:

# Generated by LVM2 version 2.02.39 (2008-06-27): Tue Jul 28 13:02:14 2009

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing '/sbin/vgextend DSLVM01 /dev/sdc1'"

creation_host = "dunzserver01"  # Linux dunzserver01 2.6.28-13-server #45-Ubuntu SMP Tue Jun 30 22:56:18 UTC 2009 x86_64
creation_time = 1248782534      # Tue Jul 28 13:02:14 2009

DSLVM01 {
        id = "UNT7xX-SHMe-KpBQ-M6NA-H1o1-u6Kg-v0hovo"
        seqno = 2
        status = ["RESIZEABLE", "READ", "WRITE"]
        extent_size = 8192              # 4 Megabytes
        max_lv = 256
        max_pv = 256

        physical_volumes {

                pv0 {
                        id = "nNbbs8-9pxH-5WTm-7A9N-6HlS-GRNH-6SejoR"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 1953520002  # 931.511 Gigabytes
                        pe_start = 384
                        pe_count = 238466      # 931.508 Gigabytes
                }

                pv1 {
                        id = "rq6Lci-49KZ-i76E-zdsA-6l0J-PbaL-2AO7fq"
                        device = "/dev/sdc1"    # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 1953520002  # 931.511 Gigabytes
                        pe_start = 384
                        pe_count = 238466      # 931.508 Gigabytes
                }
        }

}

...but there are no other references to DSLVM01. Can anyone point me in the right direction please?

TIA, Simplified

catkin 07-28-2009 08:25 AM

Hello simplified :)

You need to create a logical volume and then a file system on the LVM volume before you can mount it.

See lvcreate and mkfs.ext3 (assuming you do want ext3).

Good guides: http://tldp.org/HOWTO/LVM-HOWTO/ and http://dev.riseup.net/grimoire/storage/lvm2/. Physical volumes added to volume group out of which make logical volumes and then make file systems in the logical volumes.

Best

Charles

simplified 07-28-2009 08:29 AM

Quote:

Originally Posted by catkin (Post 3622866)
Hello simplified :)

You need to create a logical volume and then a file system on the LVM volume before you can mount it.

See lvcreate and mkfs.ext3 (assuming you do want ext3).

Good guides: http://tldp.org/HOWTO/LVM-HOWTO/ and http://dev.riseup.net/grimoire/storage/lvm2/. Physical volumes added to volume group out of which make logical volumes and then make file systems in the logical volumes.

Best

Charles

Hey Charles - Thanks, I'll check that one out and let you know how I get on. I appreciate the help! :D

simplified 07-28-2009 11:04 AM

Quote:

Originally Posted by catkin (Post 3622866)
Hello simplified :)

You need to create a logical volume and then a file system on the LVM volume before you can mount it.

See lvcreate and mkfs.ext3 (assuming you do want ext3).

Good guides: http://tldp.org/HOWTO/LVM-HOWTO/ and http://dev.riseup.net/grimoire/storage/lvm2/. Physical volumes added to volume group out of which make logical volumes and then make file systems in the logical volumes.

Best

Charles

Hi Charles

I just wanted to say *big* thanks! Although I ended up doing all of this via the shell I did find that this was possible via system-config-lvm once you understood the terminology, so reading the howto on tldp was a *great* help!

Cheers buddy! I only wish I could return the favour :D

divyashree 07-28-2009 11:21 AM

After creating physical volumes you should create volume groups and then create the logical volumes then format with any filesystem(ext2,ext3,vfat) and then only u can mount it to /home mount point after which it'll work properly..

simplified 07-28-2009 11:39 AM

Quote:

Originally Posted by divyashree (Post 3623069)
After creating physical volumes you should create volume groups and then create the logical volumes then format with any filesystem(ext2,ext3,vfat) and then only u can mount it to /home mount point after which it'll work properly..

Yep! Done that, all working, thanks! :)


All times are GMT -5. The time now is 05:32 PM.