LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2013, 08:24 PM   #1
lax617
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Rep: Reputation: Disabled
Problem with adding disk space and LVM


Hello,

I am trying to add some space to a disk using the instructions at the following URL: http://www.rootusers.com/how-to-incr...-machine-disk/

I was able to use these instructions successfully on two VMware virtual machines, but I ran into a problem with the third. I am trying to increase /dev/sdc from 200GB to 300GB. According to fdisk I was able to accomplish the first part:

Code:
[root@myVM /]# fdisk -l

Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 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        7832    62806117+  8e  Linux LVM

Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc2               1       39162   314568733+  8e  Linux LVM

Disk /dev/sdd: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table
[root@myVM /]#
When I try to create the physical volume I ran into a problem:

Code:
[root@myVM /]# pvcreate /dev/sdc2
  Can't open /dev/sdc2 exclusively.  Mounted filesystem?
[root@myVM /]#
For some reason when I use vgdisplay, I don't see the the volume group I want to extend: (VolGroup02)

Code:
[root@myVM /]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup03
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               200.00 GB
  PE Size               4.00 MB
  Total PE              51199
  Alloc PE / Size       51199 / 200.00 GB
  Free  PE / Size       0 / 0
  VG UUID               S0gLjw-vpz3-c82q-wq3t-5YoP-yq7L-5Dbq90

  --- Volume group ---
  VG Name               VolGroup01
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               200.00 GB
  PE Size               4.00 MB
  Total PE              51199
  Alloc PE / Size       51199 / 200.00 GB
  Free  PE / Size       0 / 0
  VG UUID               44oa6V-5fAq-ekx7-A9MP-ihBE-g2k7-F3Ev8i

  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               59.88 GB
  PE Size               32.00 MB
  Total PE              1916
  Alloc PE / Size       1916 / 59.88 GB
  Free  PE / Size       0 / 0
  VG UUID               6nwysb-dXHn-dvvs-PMbG-fauV-3ca9-obvubY
I don't see this volume group when I run a pvscan either?

Code:
[root@myVM /]# pvscan
  PV /dev/sdd    VG VolGroup03   lvm2 [200.00 GB / 0    free]
  PV /dev/sdb    VG VolGroup01   lvm2 [200.00 GB / 0    free]
  PV /dev/sda2   VG VolGroup00   lvm2 [59.88 GB / 0    free]
  Total: 3 [459.87 GB] / in use: 3 [459.87 GB] / in no VG: 0 [0   ]
[root@myVM /]#
I'm not sure what's up, but I'm nervous as there's already about 150GB of data that I'd rather not lose. If it matters, this is an NFS export that other VMs connect to.

When I run df I see the LVM is there and it's accessible:

Code:
[root@myVM /]# df -h /NFS01
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup02-LogVol00
                      197G  187G  8.2G  96% /NFS01
[root@myVM /]#
I ran some other checks I read online, but I'm nervous to pull the trigger on anything out of fear of losing what's on the disk now. I'm not very familiar with LVM.

Code:
[root@myVM /]# dmsetup info -c /dev/mapper/VolGroup02-LogVol00
Name                Maj Min Stat Open Targ Event  UUID
VolGroup02-LogVol00 253   3 L--w    1    1      0 LVM-NGdqjcQ2AuRfdCQjMvzIz5Ki9MYUPoAfTfG5aH08s7F2bp7A0fBJe9Po1jDnPoOz
[root@myVM /]#

I'm worried if I tried to extend the volume group I'll blow everything away as it appears something is wrong. I'm just not sure what.

Is there anything else I should check? Any idea why I don't see the volume group?

Thanks
 
Old 12-03-2013, 06:25 AM   #2
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
PVCREATE seems not finding the physical volume reference. Did you change the partition type to '8e'?

See if this link gives some info :
http://www.linuxquestions.org/questi...t-sdb1-527940/

Most probably it seems linked with improper partition name reference only (as /dev/sdc2 is there already). Moreover, 'vgdisplay' will not show the partition, unless you assign physical partition through vgcreate, so vgdisplay not showing the details is obvious.
 
Old 12-03-2013, 06:30 AM   #3
lax617
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi, thanks for responding. In the output of fdisk -l you can see /dev/sdc2 is 8e.
 
Old 12-03-2013, 06:46 AM   #4
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Yeh, my bad. Didn't see that.
I will suggest to try with a different volume name reference (other than SDC2) and see if that allows you to move further. Also need not to worry about data loss, as LVM requires no formatting of Disk, and we create additional space from the available free disk-space only.
 
Old 12-03-2013, 07:10 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Code:
[root@myVM /]# pvcreate /dev/sdc2
  Can't open /dev/sdc2 exclusively.  Mounted filesystem?
That would make me wonder. Specially as the system is mounted.
I'm not sure if you can extend a volume group if one of its logical volumes is mounted. So unmount, extend vl, exten lv, extend fs, remount.

In case of fear of data loose play the backup card.
 
Old 12-03-2013, 07:27 AM   #6
lax617
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks. I started an additional backup this morning just in case.
 
Old 12-03-2013, 07:38 AM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,848
Blog Entries: 36

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
First I'd like to point out... 460GB is nothing. Run to a store and purchase a harddrive. Copy all data on the volume to it. Remember, hard drives are cheap and data is expensive. I have two blog posts relating to LVM you might find of interest: Extending an LVM volume and removing files with find and LVM snapshots.
 
Old 12-03-2013, 07:55 AM   #8
lax617
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
No need for a new drive as I'm connected to a large SAN. When I use pvdisplay to look at the physical volumes I get the following;

Code:
[root@myVM]# pvdisplay /dev/sdc2
  No physical volume label read from /dev/sdc2
  Failed to read physical volume "/dev/sdc2"
[root@myVM]# pvdisplay /dev/sdc
  Failed to read physical volume "/dev/sdc"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding a New Disk and LVM devUnix Linux - General 4 11-15-2013 12:52 PM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
Adding a new Space to LVM ? your_shadow03 Linux - Newbie 6 12-15-2009 05:10 AM
Problem adding new disk via in FD6 system-config-lvm BurntChips Fedora 0 11-16-2006 12:24 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 03:58 PM


All times are GMT -5. The time now is 11:41 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration