Solved

How to mount LVM volume on RedHat ES 5.6

Posted on 2011-03-01
9
1,246 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Setting up RAID5 on HP ProLiant DL380G5 15 72
Linux Real Time Memory on Distinct 24 Cycle 7 29
EqualLogic PS3000 Switch Port Setup 1 24
Hyper-v migrate to new storage 1 36
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

829 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