Solved

How to mount LVM volume on RedHat ES 5.6

Posted on 2011-03-01
9
1,240 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
9 Comments
 
LVL 76

Accepted Solution

by:
arnold earned 300 total points
Comment Utility
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
Comment Utility
mount /dev/my_volume_group/my_logical_volume /mnt

cheers
0
 

Author Comment

by:andersenks
Comment Utility
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
 
LVL 6

Assisted Solution

by:Bxoz
Bxoz earned 200 total points
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:andersenks
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank You
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now