LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-13-2006, 11:15 AM   #1
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Rep: Reputation: 30
New Volume Group Doesnt Show added Hard Drive


Good Day

I have a Enterprise Server with Volume Group of 2 x 400GB hard Drives to give me the following configuration.

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
732G 680G 16G 98% /
/dev/sda1 99M 19M 76M 20% /boot
none 1014M 0 1014M 0% /dev/shm
/dev/sdc1 276G 258G 3.4G 99% /media/usbdisk4

I added an Additional 200GB hardrive and created a LVM drive using "pvcreate" and added it to the Volume Group 00. But this hard drive doesnt show up on the df -h as additional space.
When I run a pvscan I get the following output:

PV /dev/sdb1 VG VolGroup00 lvm2 [372.59 GB / 0 free]
PV /dev/sda2 VG VolGroup00 lvm2 [372.50 GB / 64.00 MB free]
PV /dev/hda1 VG VolGroup00 lvm2 [186.28 GB / 186.28 GB free]
Total: 3 [931.38 GB] / in use: 3 [931.38 GB] / in no VG: 0 [0 ]

When I run a vgdisplay I get the following output:

--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 3
Act PV 3
VG Size 931.38 GB
PE Size 32.00 MB
Total PE 29804
Alloc PE / Size 23841 / 745.03 GB
Free PE / Size 5963 / 186.34 GB
VG UUID Mykxte-H9Xc-kAaw-L0w5-Pe0K-g2dU-EY3GWm

Why doesnt my additional harddrive space show up on the server when i run df -h, also as the server is a SAMBA server it doesnt show up as additional space under windows, what should i do to show the additional space??

Regards

Shawn
 
Old 08-13-2006, 11:45 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
LVM steps:

pvcreate - Makes drive ready for LVM
vgextend - Adds the new drive to the volume group
lvcreate - Adds a new logical volume
lvextend - Extends and existing logical volume

I didn't see where you had done either lvcreate or lvextend though by inference it sounds as if you did the vgextend.

df has nothing to do with LVM but rather with filesystems. Filesystems can be formatted disk partitions, logical volumes or even ram disks.

To add a filesystem to a logical volume you have to have done the lvcreate then do a mkfs on the logical volume. (The logical volume doesn't automatically have a filesystem on it - you might be wanting to use it for swap or raw database storage and not need a filesystem.) See "man mkfs"

Once you've done the mkfs you would need to mount the filesystem on a mount point. "See "man mount".

You'd also want to add it to /etc/fstab so it mounts automatically after reboots. See "man fstab"

Only AFTER you've done the mount would it appear in df output as df shows you what is in the mnttab.

P.S. Do NOT do mkfs on an EXISTING filesystem. It will erase it. It will be much easier for you to make a new one thatn to add to an existing one.

Last edited by MensaWater; 08-13-2006 at 11:47 AM.
 
Old 08-14-2006, 01:01 AM   #3
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
Good Day

Ok I am a little confused.. I did use pvcreate and vgextend, I just want to add the new harddrive /dev/hda1 to the existing volume group = VolGroup00. There is no way I can mkfs on the system as it is live and has over 600GB of information on it.

I was just using df -h to see the size of the existing volume group,when I run vgdisplay it shows that the new 200GB harddrive (/dev/hda1) has been added to the VolGroup00

When I did a pvcreate I thought the filesystem was created there as i used 8e to make it LVM,and thought i then just added it to the the Volume Group??

Cheers
 
Old 08-15-2006, 11:57 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
df is used to show FILESYSTEMS not volume groups. df shows both the device and the mountpoint. You're confused because the device for most of your mountpoints IS logical volumes. Despite this you are ONLY seeing the logical volumes and not the full volume groups.

The command to see volume groups is vgdisplay.

Example of df -h from one of my systems:
Quote:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.0G 238M 4.5G 5% /
/dev/sda1 190M 20M 162M 11% /boot
none 379M 0 379M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol05
1008M 34M 924M 4% /home
/dev/mapper/VolGroup00-LogVol06
5.0G 43M 4.7G 1% /opt
/dev/mapper/VolGroup00-LogVol02
1008M 34M 924M 4% /tmp
/dev/mapper/VolGroup00-LogVol03
6.0G 2.3G 3.5G 40% /usr
/dev/mapper/VolGroup00-LogVol04
4.0G 137M 3.7G 4% /var
Example of vgdisplay from the same system:


Quote:
vgdisplay -v
Finding all volume groups
Finding volume group "VolGroup00"
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 7
Open LV 7
Max PV 0
Cur PV 1
Act PV 1
VG Size 25.22 GB
PE Size 32.00 MB
Total PE 807
Alloc PE / Size 752 / 23.50 GB
Free PE / Size 55 / 1.72 GB
VG UUID biRrc2-obVb-Hau3-N3VX-JqNC-ELm4-32wQbR

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID qYcfYw-OzhJ-Cjc0-MxBO-6LqH-H0P3-1137zg
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GB
Current LE 160
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol05
VG Name VolGroup00
LV UUID mCq89d-zevV-0Omz-aljV-b5oD-yJdF-AYNANH
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol06
VG Name VolGroup00
LV UUID KMxd3P-7w8T-3JDZ-mIpo-KUCs-nSjJ-tGk2fc
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GB
Current LE 160
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol02
VG Name VolGroup00
LV UUID yYA7Py-LVFP-yGTu-Nf7c-6IvA-6qpZ-qRVAfu
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:3

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol03
VG Name VolGroup00
LV UUID GMe2w7-yVy2-uSYP-icXD-Gu9G-CQ2m-i7lMaz
LV Write Access read/write
LV Status available
# open 1
LV Size 6.00 GB
Current LE 192
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:4

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol04
VG Name VolGroup00
LV UUID SAoRQS-MVji-HSJ8-N9sV-TxRZ-rGwA-9YBHjp
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:5

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID cBGtCM-RMLk-apbG-FXeP-5a6N-G2Yu-0Nr9dD
LV Write Access read/write
LV Status available
# open 1
LV Size 1.50 GB
Current LE 48
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:6

--- Physical volumes ---
PV Name /dev/sda2
PV UUID 4euzSW-1QbJ-uBCS-ulD1-g1Sq-P7Yw-MdZaOH
PV Status allocatable
Total PE / Free PE 807 / 55

What you really want is the vgdisplay. At the end it will show you which Physical Volumes are in the volume group.

Note that df -h above shows
"/dev/sda1 190M 20M 162M 11% /boot"
which is NOT a logical volume.

Note also that df -h does not show swap even though it is on a logical volume.
grep swap /etc/fstab
/dev/VolGroup00/LogVol01 swap swap defaults 0 0

However LogVol01 IS shown by the vgdisplay output.

So restating my earlier post:

Physcial Volume --> Volume Group
Volume Group --> Logical Volumes
Logical Volumes --> Filesystems

pvcreate and vgextend ONLY put it into the Volume Group. It doesn't put it into a Logical Volume or make a filesystem out of it.
 
Old 08-16-2006, 12:35 AM   #5
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
Thanks

What a nightmare..I will have to approach this carefully so I dont lose any data, thanks for your time.

Cheers
 
Old 08-17-2006, 02:57 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It's not really that bad. Just seems complicated when you're not used to it. Windows does give you many choices so only seems easier to administer simply due to the lack of choices. Linux/UNIX are designed to allow you to run things the way you want so you can even rewrite the kernel if you wish.
 
Old 08-24-2006, 04:52 AM   #7
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
Good Day

Basically I am afraid I am going to F*^%*k this up

I have got to the point where you state I must do a lvcreate as per your thread.

If I do a pvdisplay this is the output

pvdisplay
--- Physical volume ---
PV Name /dev/sdb1
VG Name VolGroup00
PV Size 372.59 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 11923
Free PE 0
Allocated PE 11923
PV UUID xIqcn6-nk2X-JIp3-2ksr-SDTf-ZJYC-WnSLRB

--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 372.50 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 11920
Free PE 2
Allocated PE 11918
PV UUID EBxaMN-7dFf-ldh2-uYl1-WkcK-6tWs-GhaoPG

--- Physical volume ---
PV Name /dev/hda1
VG Name VolGroup00
PV Size 186.28 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 5961
Free PE 5961
Allocated PE 0
PV UUID 8xftzz-Ct7b-bYpo-3K7u-19qu-tGze-lBVww4


This is the output from my lvdisplay

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID cG5Mxe-nbVy-DWdV-QUKd-fBy5-r5Ki-GxvOfl
LV Write Access read/write
LV Status available
# open 1
LV Size 743.09 GB
Current LE 23779
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID kqYsvZ-f6aD-0wF3-AMG7-ZcuK-2LG6-i9gk2d
LV Write Access read/write
LV Status available
# open 1
LV Size 1.94 GB
Current LE 62
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1


Now all I want to do is add the 200GB IDE hard drive to the VolumeGroup00.

I see you talk about mkfs, but I too scared to go and run a mkfs otherwise I might erase all the data (700GB worth of Architectual drawings)

I would appreciate if you could show me step by step how to add the /dev/hda1 so that the users can use the space on it.

Cheers
 
Old 08-24-2006, 09:19 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Your pvdisplay shows:
/dev/sdb1 0 Free PE - So its full
/dev/sda2 2 Free PE - So it has about 64 MB free (32768 PE Size = 32MB PE size X 2 free PE).
/dev/hda1 5961 Free PE - So its empty and has 186.28 GB free. This is presumably your 200 GB drive (200 GB being "raw capacity ".)

Doing an lvcreate with a new LV name will not overwrite any existing LV. (lvextend would be a little trickier). You could create a new LV that included all the 64 MB of space that is free in /dev/sda2 and the 186 GB free on /dev/had1. Or you could create one or more smaller LVs using that space.

Currently you have 1 VG (VolGroup00) with 2 LVs (LogVol00 and LogVol01). They have different sizes.

You can lvcreate a 3rd LV which you can call anything but for consistence would probably want to call LogVol02.

So say you wanted to create a new LV named LogVol02 using only the space on /dev/hda1 but wanted to leave a little free for future growth - say a 150 GB filsystem. You'd do:

lvcreate -L 150G -n LogVol02 VolGroup00 /dev/hda1

Once done you can do lvdisplay again and should see the new LogVol02 in VolGroup00.

That makes a LV available as a "device" but it is not yet a "filesystem".

You have to use mkfs tto put a "filesystem" on the LV "device".

So to put an ext3 type filesystem on the LV "device" you would type:

mkfs -t ext3 /dev/VolGroup00/LogVol02

This makes the LV "device" a "filesystem" but does not "mount" the filesystem so there are a couple of other steps necessary.

1) Decide where your want this mounted. e.g. if your current architectural drawings were in /archdraw you might want to mount the new filesystem in /archdraw2.
2) Make the directory "mount point" with the command:
mkdir /archdraw2 (this is an empty directory).
3) Add the new filesystem to your fstab so it will mount automatically after reboots:
-a) cp -p /etc/fstab /etc/fstab.20060824 (saves a copy of your original - always a good idea when editing key system files).
-b) vi /etc/fstab
Add a line like:
/dev/VolGroup00/LogVol02 /archdraw2 ext3 defaults 1 2
Save and quit file.
4) Type "mount /archdraw2". This will read the fstab and mount LovVol02 on /archdraw2.

When done do a df and you'll see /archdraw2 is now mounted and has approximately the 150 GB you specified. (It won't be exact due to filesystem overhead.).

You don't have to call it /archdraw2. It can be any name that makes sense to you so long as it is not already in use.
 
Old 08-25-2006, 03:45 AM   #9
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
jlightner

You are a squire and a gentleman..Thank you

Now reading through your instructions it suddenly made sense to me!!!

I actually wanted to add it to the VolLog00, but as you have explained this seems much easier.My Users have an extra 150GB, some very happy Architects..

Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
Added a second Hard Drive chriszurawski Linux - Hardware 2 04-11-2006 01:29 PM
Does Anyone Know About The Hard Drive Volume Group harley51 Fedora 1 11-21-2004 07:13 PM
Hard Drive Volume Group harley51 Fedora 0 11-20-2004 07:26 PM
Second hard drive doesn't show up GreenerLinux Libranet 4 11-17-2003 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration