LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How does one add drives to an existing LVM (https://www.linuxquestions.org/questions/slackware-14/how-does-one-add-drives-to-an-existing-lvm-797091/)

interndan 03-22-2010 01:13 PM

How does one add drives to an existing LVM
 
I am trying to set up a system for an ftp server. I have one ide drive with base system installed. There are four sata drives installed which I tried to set up as LVM. After following the steps from another post. I managed to get LVM working but only with one of the sata drives. The sata drives show up as SDA, SDB, SDC, and SDD. only SDA is in the LVM. All are configured as 8e filetype.

Thanks for any help

Dan

piratesmack 03-22-2010 02:28 PM

Run 'pvcreate' on /dev/sdb1, /dev/sdc1, and /dev/sdd1

Then use vgextend to add them to your volume group:
Code:

vgextend YOUR_VG /dev/sdb1 /dev/sdc1 /dev/sdd1
I think

http://www.tldp.org/HOWTO/LVM-HOWTO/addpvstovg.html

interndan 03-22-2010 04:26 PM

It seemed to accept thos commands ok (I got no errors) but I still only seem to have one drive in the LVM.

Thanks

gegechris99 03-22-2010 04:41 PM

Quote:

Originally Posted by interndan (Post 3908021)
It seemed to accept thos commands ok (I got no errors) but I still only seem to have one drive in the LVM.

Please give the output of command (run as root):

Code:

pvdisplay

interndan 03-23-2010 08:22 AM

Sorry for the delay. Had to move to a more pressing problem. here is the output of pvdisplay:
Code:

--- Physical volume ---
  PV Name              /dev/sda1
  VG Name              ftp
  PV Size              233.76 GB / not usable 2.90 MB
  Allocatable          yes (but full)
  PE Size (KByte)      4096
  Total PE              59841
  Free PE              0
  Allocated PE          59841
  PV UUID              mTz58H-AweV-FKat-wtOQ-go5V-FUnz-yk2zXH
 
  --- Physical volume ---
  PV Name              /dev/sdb1
  VG Name              ftp
  PV Size              233.76 GB / not usable 2.90 MB
  Allocatable          yes
  PE Size (KByte)      4096
  Total PE              59841
  Free PE              59841
  Allocated PE          0
  PV UUID              K2Gynw-2K1g-lAgF-lHqy-E4Nh-MuYm-qcSEas
 
  --- Physical volume ---
  PV Name              /dev/sdc1
  VG Name              ftp
  PV Size              233.76 GB / not usable 2.90 MB
  Allocatable          yes
  PE Size (KByte)      4096
  Total PE              59841
  Free PE              59841
  Allocated PE          0
  PV UUID              rZG0VG-gFBc-WPW0-hRJq-sZSW-k43n-s3ExmZ
 
  --- Physical volume ---
  PV Name              /dev/sdd1
  VG Name              ftp
  PV Size              233.76 GB / not usable 2.90 MB
  Allocatable          yes
  PE Size (KByte)      4096
  Total PE              59841
  Free PE              59841
  Allocated PE          0
  PV UUID              FJRMJb-32iK-mSDw-Xiq0-zCa4-bMsR-RuAHhm

[code]

gegechris99 03-23-2010 09:43 AM

Hello,

All your physical volumes (/dev/sda1, /dev/sdb1, /dev/sdc1 and /dev/sdd1) have been assigned to Volume Group "ftp". You could also have seen it by running:

Code:

vgdisplay
So I'm not sure what you meant when you said:

Quote:

I still only seem to have one drive in the LVM.
To which drive are you referring?

By the way, this presentation of LVM might be of interest to you: lvm2

GazL 03-23-2010 10:32 AM

I suspect that the steps you're missing are the
lvextend and the resize2fs (assuming you're using an ext fs)

LVM is not something to be taken lightly. I strongly suggest you read up on it, lest there be tears before bedtime.

BTW, I find the pvs and lvs commands to be the most succinct way of displaying a summary of lvm information.

Thom1b 03-23-2010 10:55 AM

The most important thing to remember is : the size of your filesystem must NEVER be greater than the size of your partition.

interndan 03-23-2010 12:53 PM

I'm sure I'm probably missing several steps :).
here is the output of pvs:
Code:

  PV        VG  Fmt  Attr PSize  PFree 
  /dev/sda1  ftp  lvm2 a-  233.75G      0
  /dev/sdb1  ftp  lvm2 a-  233.75G 233.75G
  /dev/sdc1  ftp  lvm2 a-  233.75G 233.75G
  /dev/sdd1  ftp  lvm2 a-  233.75G 233.75G

and lvs:
Code:

  LV    VG  Attr  LSize  Origin Snap%  Move Log Copy%  Convert
  video ftp  -wi-ao 233.75G

I mounted the LVM at /home/video during installation. Right clicking on the /home/video folder in Thunar only shows ~ 233G available

Thanks for your help.

piratesmack 03-23-2010 01:52 PM

So you want your logical volume to use all the free space?
You can boot from a live cd (the Slackware install disk will also work) and do
Code:

vgscan --mknodes
vgchange -ay
lvextend -l +100%FREE /dev/ftp/video
resize2fs /dev/ftp/video #this is only for ext2/ext3/ext4

Read this for resizing other filesystems:
http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html

interndan 03-23-2010 04:05 PM

Thank you Thank You!! That did the trick.
Now how do I mark this thread solved?

interndan 03-23-2010 04:20 PM

Never mind, I figured it out.


All times are GMT -5. The time now is 01:12 AM.