LVM IDE harddisk's

pbecks1963
Posts: 51
Joined: Fri Dec 12, 2008 12:24 am
Location: Netherlands/Zutphen

LVM IDE harddisk's

Postby pbecks1963 » Thu Jan 08, 2009 7:13 am

Hello,

I installed AMAHI (accidentaly) as a LVM-server. My 3 IDE-harddisks are now treated as one. I sort off like it though. (even though there is a risk that i loose all the data if one harddisk goes corrupt!)

I want to add a fourth IDE-harddisk to the LVM but i don't know how!

Any ideas?

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: LVM IDE harddisk's

Postby cpg » Sun Jan 11, 2009 7:26 pm

Hmm, sorry, not too much LVM experience here.

LVM Howto?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: LVM IDE harddisk's

Postby moredruid » Thu Jan 29, 2009 4:44 am

as promised a quick tutorial on adding a new physical disk to an LVM
(all info is provided as-is :mrgreen:)

easy basic stuff, but still important
  • shut down your hda
  • open the case, place and connect your harddrive as per your manufacturers instructions
  • start computer, check in the BIOS that your drive is recognized properly
  • shut down your computer and close the case
  • boot your hda
now the real work
linux counts the disks this way: disk 1 is /dev/sda, disk 2 /dev/sdb, disk 3 /dev/sdc etc.
Some older distro's see IDE (PATA, not SATA) disks as /dev/hda, /dev/hdb etc.
warning: I will explain adding a 2nd harddrive and I assume the following:
- your volumegroup is called vgdata
- your logical volume is called lvdata
- you're using ext3 as your filesystem
  • login as root
  • type "fdisk -l" for a list of your partitons (optional)
  • type "fdisk /dev/sdb" => you will enter a menu
    n => create new partition
    p => make partition primary
    1 => this is the partition number
    t => this is the filesystem type, choose or type 8e for linux extended (LV)
    w => write changes to disk
  • type "pvcreate /dev/sdb1"
  • type "vgextend vgdata /dev/sdb1"
  • type "vgdisplay -v vgdata", you should see the available new space, take note how much you can add
  • type "lvextend -L +<number of GB you want to add, see notes from 1 step earlier>G /dev/vgdata/lvdata /dev/sdb1"
    example: "lvextend -L +700G /dev/vgdata/lvdata /dev/sdb1" to add 700 GB to the logical volume
  • type "resize2fs /dev/vgdata/lvdata", wait till completed
  • type "df -h", you can see that your % of space has increased
  • sit back and feel one with the universe. You are now completely zen and even though you have no idea what it is you have just done you have a certain sense of accomplishment.
  • (optional) invite me to your BBQ
Last edited by moredruid on Tue Mar 31, 2009 11:37 pm, edited 2 times in total.
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

pbecks1963
Posts: 51
Joined: Fri Dec 12, 2008 12:24 am
Location: Netherlands/Zutphen

Re: LVM IDE harddisk's

Postby pbecks1963 » Thu Jan 29, 2009 11:38 am

Hello Moredruid,

I get this error...

[root@localhost ~]# lvextend -L +40G /dev/vgdata/lvdata /dev/sdb1
Volume group "vgdata" not found
Volume group vgdata doesn't exist

?

ps: i am adding a 40 Gb harddrive (sdb)

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: LVM IDE harddisk's

Postby moredruid » Thu Jan 29, 2009 11:51 am

you should note that I assume your volumegroup is called "vgdata" and your logical volume is called "lvdata"

the defaults in Fedora are different from this, since you didn't set up the LVM by hand I think you have the default setup.

the default name for the volume group is: Volgroup00
the default name for the logical volume is: LogVol00

you can substitute the vgdata & lvdata with those.
your command would be like this:

Code: Select all

lvextend -L +40G /dev/VolGroup00/LogVol00 /dev/sdb1
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

pbecks1963
Posts: 51
Joined: Fri Dec 12, 2008 12:24 am
Location: Netherlands/Zutphen

Re: LVM IDE harddisk's

Postby pbecks1963 » Thu Jan 29, 2009 12:23 pm

[root@localhost ~]# lvextend -L +40G /dev/VolGroup00/LogVol00 /dev/sdb1
Physical Volume "/dev/sdb1" not found in Volume Group "VolGroup00"

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: LVM IDE harddisk's

Postby moredruid » Thu Jan 29, 2009 12:28 pm

you've added /dev/sdb1 to volumegroup vgdata first.
you should run "vgremove vgdata"
then run "vgextend VolGroup00 /dev/sdb1"
then proceed with the lv-command
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

pbecks1963
Posts: 51
Joined: Fri Dec 12, 2008 12:24 am
Location: Netherlands/Zutphen

Re: LVM IDE harddisk's

Postby pbecks1963 » Thu Jan 29, 2009 12:48 pm

[root@localhost ~]# vgremove vgdata
Volume group "vgdata" not found
[root@localhost ~]

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: LVM IDE harddisk's

Postby moredruid » Thu Jan 29, 2009 12:50 pm

and just vgextend VolGroup00 /dev/sdb1 ?
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

pbecks1963
Posts: 51
Joined: Fri Dec 12, 2008 12:24 am
Location: Netherlands/Zutphen

Re: LVM IDE harddisk's

Postby pbecks1963 » Thu Jan 29, 2009 1:19 pm

my hda just died on me.... No display on the monitor??? I had to shut it down by holding down the power off button. I restarted the server and everything seems to be ok.


What do you suggest i do now? (haven't done your last tip)

Who is online

Users browsing this forum: No registered users and 39 guests