Skip to contentSkip to conversation

How exactly does LVM's get written?

linux-lvm Kevin Richard 2 participants 3 messages Nov 5, 2004

lore
Share & tools
lore
#0 lore raw

I have searched many topics in archive and even randomly scanned for any info related to this but have only come away with a "I think it works this way" feeling.

I set up two 80gig drives as one 160gig VG /dev/VG1/LV1 I then proceeded to copy about 93 gigs of data from a 100gig drive that I will hopefully add to the LV to make it 260gigs.

My questions are:

1. Is this a "spill over" type of write method where it will fill up hde1 (first 80gig) and then move to hdf1 (other 80gig) and then of coarse on to hdg1 (100gig)? Which would allow me the convenience of having one HUGE mount and thus not having to constantly monitor and move data to 3 different drives as space is needed. Yet it keeps the data somewhat separated (except for the "spill over" that might get wrote to two drives at some point) so if I lose a hard drive I only lose what is on that drive and can just replace the drive and recreate the VG and salvage all the data on the other two drives. Is this a correct assumption? I am trying to avoid the disaster of a Raid 0 type of system where if you lose one drive you have lost all 3 drives!

2. Is there any way to tell what PE's contain what data? or to see how the volumes are filling up? This would essentially allow me to answer my own first question and also verify that it is doing as I want it to do. To clarify, I would be able to tell that Datafile.X which is a 1gig file is written to PE's stored on hde1 or hde1 AND hdf1.

Thanks for taking the time to read this and help out a Noob! If this all works out I will definitely be spreading the gospel about LVMs for not many folks are really aware of them too much it seems.

Look forward to hearing your responses,
Kevin

#1 lore raw
Quoted 10 lines · Kevin Richard

I have searched many topics in archive and even randomly scanned for any info related to this but have only come away with a "I think it works this way" feeling.

I set up two 80gig drives as one 160gig VG /dev/VG1/LV1 I then proceeded to copy about 93 gigs of data from a 100gig drive that I will hopefully add to the LV to make it 260gigs.

My questions are:

Quoted 12 lines

1. Is this a "spill over" type of write method where it will fill up hde1 (first 80gig) and then move to hdf1 (other 80gig) and then of coarse on to hdg1 (100gig)? Which would allow me the convenience of having one HUGE mount and thus not having to constantly monitor and move data to 3 different drives as space is needed. Yet it keeps the data somewhat separated (except for the "spill over" that might get wrote to two drives at some point) so if I lose a hard drive I only lose what is on that drive and can just replace the drive and recreate the VG and salvage all the data on the other two drives. Is this a correct assumption? I am trying to avoid the disaster of a Raid 0 type of system where if you lose one drive you have lost all 3 drives!

I'm no LVM expert, but I see this question a lot. I think its because of a misunderstanding of the seperation of filesystem from block device.

Each volume group has a number of physical volumes in it. When you add a logical volume, the PE's in each PV are allocated in a pretty much linear fashion, unless you specify striping. So if you allocate 90G from your original 160G VG, you'll get 80G on the first disk, and then 10G from the second. The idea behind LVM is that you don't care which drives the PE's come from, they're just there and available with your data on them.

Quoted 6 lines

2. Is there any way to tell what PE's contain what data? or to see how the volumes are filling up? This would essentially allow me to answer my own first question and also verify that it is doing as I want it to do. To clarify, I would be able to tell that Datafile.X which is a 1gig file is written to PE's stored on hde1 or hde1 AND hdf1.

My first inclination would be "no". LVM thinks the PE's are "filled" when they're allocated. It doesn't really care what is writing to each PE, and whether or not its data, journal, new filesystem, etc.

This is why I personally think its a really bad idea to use LVM without some sort of disk redundancy. Even if "I can lose the data and it won't matter", how much is your time worth? They're so darn cheap now... just use RAID5 and you'll be much happier.

Signature · 1 line
Clint Byrum <[email protected]>
#2 lore raw

That's basically what I gathered from what I had been reading also... is there any way to "defrag" so to speak the data, so say I end up deleting data from 300mb of PE's on disk1 then when I write 600mb or data, I don't want 300mb to go to disk1 and 300mb to disk2 cause after any bit of time has passed on a fairly used system it will no longer really be linear at all! I guess I'm asking a lot for this system :(

Cheap is a relative term ;) I just got the two 80gigs and only because there was a $60 rebate on each of them from Bestbuy so I got to fudge one of my rebate forms to be sent to someone else to get my $120 for both drives ;)

----- Original Message -----
From: "Clint Byrum" <[email protected]>
To: "LVM general discussion and development" <[email protected]>
Sent: Friday, November 05, 2004 5:37 PM
Subject: Re: [linux-lvm] How exactly does LVM's get written?

Quoted 3 lines · Kevin Richard
Quoted 2 lines

I have searched many topics in archive and even randomly scanned for any info related to this but have only come away with a "I think it works

this

Quoted 3 lines
Quoted 3 lines

way" feeling.

I set up two 80gig drives as one 160gig VG /dev/VG1/LV1 I then

proceeded

Quoted 1 line
Quoted 1 line

to copy about 93 gigs of data from a 100gig drive that I will hopefully

add

Quoted 5 lines
Quoted 5 lines

to the LV to make it 260gigs.

My questions are:

1. Is this a "spill over" type of write method where it will fill up

hde1

Quoted 1 line
Quoted 1 line

(first 80gig) and then move to hdf1 (other 80gig) and then of coarse on

to

Quoted 2 lines
Quoted 2 lines

hdg1 (100gig)? Which would allow me the convenience of having one HUGE mount and thus not having to constantly monitor and move data to 3

different

Quoted 1 line
Quoted 1 line

drives as space is needed. Yet it keeps the data somewhat separated

(except

Quoted 1 line
Quoted 1 line

for the "spill over" that might get wrote to two drives at some point)

so if

Quoted 1 line
Quoted 1 line

I lose a hard drive I only lose what is on that drive and can just

replace

Quoted 2 lines
Quoted 2 lines

the drive and recreate the VG and salvage all the data on the other two drives. Is this a correct assumption? I am trying to avoid the

disaster of

Quoted 7 lines
Quoted 3 lines

a Raid 0 type of system where if you lose one drive you have lost all 3 drives!

I'm no LVM expert, but I see this question a lot. I think its because of a misunderstanding of the seperation of filesystem from block device.

Quoted 9 lines

Each volume group has a number of physical volumes in it. When you add a logical volume, the PE's in each PV are allocated in a pretty much linear fashion, unless you specify striping. So if you allocate 90G from your original 160G VG, you'll get 80G on the first disk, and then 10G from the second. The idea behind LVM is that you don't care which drives the PE's come from, they're just there and available with your data on them.

Quoted 1 line

2. Is there any way to tell what PE's contain what data? or to see how

the

Quoted 1 line
Quoted 1 line

volumes are filling up? This would essentially allow me to answer my

own

Quoted 23 lines
Quoted 4 lines

first question and also verify that it is doing as I want it to do. To clarify, I would be able to tell that Datafile.X which is a 1gig file is written to PE's stored on hde1 or hde1 AND hdf1.

My first inclination would be "no". LVM thinks the PE's are "filled" when they're allocated. It doesn't really care what is writing to each PE, and whether or not its data, journal, new filesystem, etc.

This is why I personally think its a really bad idea to use LVM without some sort of disk redundancy. Even if "I can lose the data and it won't matter", how much is your time worth? They're so darn cheap now... just use RAID5 and you'll be much happier.

--
Clint Byrum <[email protected]>

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/