Solved

How to mount LVM volume on RedHat ES 5.6

Posted on 2011-03-01
9
1,249 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:andersenks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 79

Accepted Solution

by:
arnold earned 300 total points
ID: 35011769
Presumably the /dev/sdb1 currently has no information

The RAID is not an option with the Guest OS as you only have two drives present.

pvcreate /dev/sdb1 #initialize device for LVM
vgcreate volumegroupname /dev/sdb1 #create LVM group using physical devices.
lvcreate -L "size of volume" -n logicalname  volumegroupname

Once you are done with this, you would need to add an entry to the /etc/fstab for mounting /dev/volumegroupname/logicalname where you want it. i.e. /home etc.

0
 
LVL 9

Expert Comment

by:expert_tanmay
ID: 35011834
mount /dev/my_volume_group/my_logical_volume /mnt

cheers
0
 

Author Comment

by:andersenks
ID: 35012009
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
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 6

Assisted Solution

by:Bxoz
Bxoz earned 200 total points
ID: 35012271
lvcreate -l +100%FREE VolGroup00 -n lvolmedia

Open in new window


So in your case i think it's "lvolmedia = the name you want"
lvcreate -l +100%FREE Storage -n lvolmedia

Open in new window


There is a very nice Article on the wiki of Archlinux
https://wiki.archlinux.org/index.php/LVM
0
 

Author Comment

by:andersenks
ID: 35012699
I don't see anything about "lvolmedia" in my config.

Should it be,,, lvcreate -l +100%FREE Storage -n Storage  ??
0
 
LVL 6

Expert Comment

by:Bxoz
ID: 35012897
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
0
 
LVL 6

Expert Comment

by:mohansahu
ID: 35017038
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
0
 

Author Comment

by:andersenks
ID: 35041651
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 ~]#
0
 

Author Closing Comment

by:andersenks
ID: 35041654
Thank You
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question