Link to home
Start Free TrialLog in
Avatar of andersenks
andersenksFlag for United States of America

asked on

How to mount LVM volume on RedHat ES 5.6

Building a Aspera/FTP server on Linux RedHat ES 5.6. The server has two virtual drives. A RAID 1 VD for the OS and a RAID 5 VD for file storage.

[root@new-host ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     132902128   2155140 123887008   2% /
/dev/sda1               101086     16050     79817  17% /boot
tmpfs                  6164244         0   6164244   0% /dev/shm
[root@new-host ~]# fdisk -l

Disk /dev/sda: 146.1 GB, 146163105792 bytes
255 heads, 63 sectors/track, 17769 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       17769   142625070   8e  Linux LVM

Disk /dev/sdb: 1497.1 GB, 1497198755840 bytes
255 heads, 63 sectors/track, 182024 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      182024  1462107748+  8e  Linux LVM
[root@new-host ~]# pvs
  PV         VG         Fmt  Attr PSize   PFree
  /dev/sda2  VolGroup00 lvm2 a-   136.00G    0   <======== OS virtual drive
  /dev/sdb1  Storage    lvm2 a-     1.36T 1.36T      <======== File Stoarge

I need help on getting the "Storage" volume to auto mount and how to access it within the file system
cat /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mount /dev/my_volume_group/my_logical_volume /mnt

cheers
Avatar of andersenks

ASKER

Thanks Arnold,
I was able to get the first two commands to work...

[root@new-host ~]# pvcreate -ff /dev/sdb1  <=== had to add -ff for it to work
Really INITIALIZE physical volume "/dev/sdb1" of volume group "Storage" [y/n]? y
  WARNING: Forcing physical volume creation on /dev/sdb1 of volume group "Storage"
  Physical volume "/dev/sdb1" successfully created
[root@new-host ~]# vgcreate Storage /dev/sdb1
  Volume group "Storage" successfully created

For the last command how do I designate the entire virtual drive to it (what syntax?) And what would be the "LogicalName"?
[root@new-host ~]# lvcreate -L "??????" -n "????????? Storage
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't see anything about "lvolmedia" in my config.

Should it be,,, lvcreate -l +100%FREE Storage -n Storage  ??
lvolmedia is the name of the logical volume so you can call it as you want
But may be it's a better idea to pick a different name than your volume group some thing like StorageLv ...

If you want to fill all the free space left on a volume group, use the next command:
lvcreate -l +100%FREE Storage -n StorageLv
Should be your your command

After that you can check with lvdisplay
Hi,

create lvm partion from volume group & mount it

lvcreate -L +100M -n lv00 /dev/sdb1

in ur case i think lvoo is lvm partion name & /dev/sdb1 is volume group.

after successfully created logical volume lv00 then formate it.

mke2fs -j /dev/sdb1/lv00 ,now define mount point to use this partitions

mount /dev/sdb1/lv00 /data/lv00

mount this partitions permanently in /etc/fstab

here make entry of newly created lvm partition like

/dev/sdb1/lv00      /data/lv00      ext3            defaults      0 0

Cheers,
MS
Got it to work, thanks for all the input...

[root@transfer ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/mapper/VolGroup00-transfer on /transfer type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@transfer ~]#
Thank You