Solved

How to mount LVM volume on RedHat ES 5.6

Posted on 2011-03-01
9
1,242 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 77

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
 
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

AWS Glacier is Amazons cheapest storage option and is their answer to a ‘Cold’ storage service.  Customers primarily use this service for archival purposes and storage of infrastructure backups.  Its unlimited storage potential and low storage cost …
Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

911 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

16 Experts available now in Live!

Get 1:1 Help Now