* [linux-lvm] Keeping swap in the middle of the disk
@ 2001-01-26 19:18 Chris Wilson
2001-01-26 19:36 ` Jos Visser
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2001-01-26 19:18 UTC (permalink / raw)
To: lvm-devel, linux-lvm
Hi folks...
I'll start off by saying that I'm new to LVM and have only started
playing with it this afternoon. Unfortunatly, already I'm frustrated. Let
me explain my situation:
I've just bought a pair of 46 gig UDMA 100 IDE disks and I'd like to
stripe data across them for speed. I'd also like to have some swap
space. Naturally I'd like this too to be fast, the linux kernel already
stripes data across swap partitions with the same priority - so problem
solved, one partition on each drive. Now the problem - in order to keep
seek times down for the swap partitions, it's got to sit in the middle of
the disk (so average distance from the disk-head to the swap partition is
low).
Each disk is partitioned as follows:
hda1 hda2 hda3 hda4
<32 meg> <22 gig> <256 meg> <22 gig>
The two drives are hda and hdc. I'd hoped it might be possible to create a
Logical Volume from hda2 and hda4, and one from hdc2 and hdc4. Then use
them as Physical Volumes to create an 88gig Logical Volume for my reiser
filesystem. It would appear that I cannot do this with LVM (pvcreate
appears to check that the devices are not logical volumes).
My options after trying quite a few things and typing to 'roadrunner
lewis@sistina.com' on IRC appear to be:
- Move the swap partition to one end of the disk and live with higher seek
times.
- Not bother striping across the two disks
- Stripe across all 4 partitions [sloooow...]
- Use MD to do linear append of hda2, hda4 and hdc2, hdc4 then use LVM
with the md0 and md1. [Not tried this - and all the different versions of
MD look rather scary!]
Please someone tell me there's another way!!! Surely this isn't such an
unreasonable request?
Cheers,
Chris Wilson
--
jakdaw@xmms.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Keeping swap in the middle of the disk
2001-01-26 19:18 [linux-lvm] Keeping swap in the middle of the disk Chris Wilson
@ 2001-01-26 19:36 ` Jos Visser
2001-01-26 19:57 ` Chris Wilson
2001-01-26 19:40 ` [linux-lvm] " Greck Cannon
2001-01-26 20:46 ` [linux-lvm] " Nils Juergens
2 siblings, 1 reply; 8+ messages in thread
From: Jos Visser @ 2001-01-26 19:36 UTC (permalink / raw)
To: linux-lvm; +Cc: lvm-devel, jakdaw
Hi Chris,
The setup you describe will work. Use pvcreate to make hda2, hda4, hdc2
and hdc2 into physical volumes, and group them into one volume group
(using vgcreate/vgextend as appropriate). Then create one big logical
volume in that vg.
However, I must say that placing the swap area's in the middle of the
disk strikes me as somewhat overkill. I dare venture that this is almost
never necessary nowadays. Theoretically you are right, but the
things modern disk drives and operating systems do to minimise disk
I/O's make it kinda hard to predict what will be going on anyways.
Optimising swapping is optimising at the wrong level of the storage
hierarchy anyway. And, on another note, it might be more worthwhile to
make sure the ReiserFS journal is in the middle of the disk, since that
is most definitely a hot spot in the file system.
++Jos
And thus it came to pass that Chris Wilson wrote:
(on Fri, Jan 26, 2001 at 07:18:23PM +0000 to be exact)
>
> Hi folks...
>
> I'll start off by saying that I'm new to LVM and have only started
> playing with it this afternoon. Unfortunatly, already I'm frustrated. Let
> me explain my situation:
>
> I've just bought a pair of 46 gig UDMA 100 IDE disks and I'd like to
> stripe data across them for speed. I'd also like to have some swap
> space. Naturally I'd like this too to be fast, the linux kernel already
> stripes data across swap partitions with the same priority - so problem
> solved, one partition on each drive. Now the problem - in order to keep
> seek times down for the swap partitions, it's got to sit in the middle of
> the disk (so average distance from the disk-head to the swap partition is
> low).
>
> Each disk is partitioned as follows:
>
> hda1 hda2 hda3 hda4
> <32 meg> <22 gig> <256 meg> <22 gig>
>
> The two drives are hda and hdc. I'd hoped it might be possible to create a
> Logical Volume from hda2 and hda4, and one from hdc2 and hdc4. Then use
> them as Physical Volumes to create an 88gig Logical Volume for my reiser
> filesystem. It would appear that I cannot do this with LVM (pvcreate
> appears to check that the devices are not logical volumes).
>
> My options after trying quite a few things and typing to 'roadrunner
> lewis@sistina.com' on IRC appear to be:
> - Move the swap partition to one end of the disk and live with higher seek
> times.
> - Not bother striping across the two disks
> - Stripe across all 4 partitions [sloooow...]
> - Use MD to do linear append of hda2, hda4 and hdc2, hdc4 then use LVM
> with the md0 and md1. [Not tried this - and all the different versions of
> MD look rather scary!]
>
> Please someone tell me there's another way!!! Surely this isn't such an
> unreasonable request?
>
> Cheers,
>
> Chris Wilson
>
> --
> jakdaw@xmms.org
>
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
--
What's real, is worth it...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [linux-lvm] Re: Keeping swap in the middle of the disk
2001-01-26 19:18 [linux-lvm] Keeping swap in the middle of the disk Chris Wilson
2001-01-26 19:36 ` Jos Visser
@ 2001-01-26 19:40 ` Greck Cannon
2001-01-26 21:13 ` Chris Wilson
2001-01-26 20:46 ` [linux-lvm] " Nils Juergens
2 siblings, 1 reply; 8+ messages in thread
From: Greck Cannon @ 2001-01-26 19:40 UTC (permalink / raw)
To: linux-lvm
On Fri, Jan 26, 2001 at 07:18:23PM +0000, Chris Wilson wrote:
|
| - Use MD to do linear append of hda2, hda4 and hdc2, hdc4 then use LVM
| with the md0 and md1. [Not tried this - and all the different versions of
| MD look rather scary!]
This is exactly what I'm doing... well, the md part anyway. md 0.90
(stock in 2.4, a patch in 2.2) is very robust, and easy to configure.
LVM on the other hand, is still kind of a mess of incompatible versions
and some serious bugs... I'm biding my time on production equipment.
Device Boot Start End Blocks Id System
/dev/sda1 1 532 4273258+ 83 Linux
/dev/sda2 533 550 144585 83 Linux
/dev/sda3 551 583 265072+ 82 Linux swap
/dev/sda4 584 1115 4273290 fd Linux raid autodetect
Device Boot Start End Blocks Id System
/dev/sdb1 1 532 4273258+ 83 Linux
/dev/sdb2 533 550 144585 83 Linux
/dev/sdb3 551 583 265072+ 82 Linux swap
/dev/sdb4 584 1115 4273290 fd Linux raid autodetect
I'm using matching priorities on the swap to stripe them, and sda4 and
sdb4 are RAID-0. Eventually I'll bind sda1 and sdb1 as RAID-0 with md
as well, and give LVM /dev/md0 and /dev/md1 as PVs.
sda2 is / (just for ease of maintenance and repair) and I dunno WHAT I'm
going to do with sdb2 yet. Maybe I'll trust md to RAID-0 sda2 and sdb2
together as /.
BTW, it's *really* nice to see someone else that still takes an interest
in what used to be some of the basics of system performance.
--greck
--
to be bored, visit http://unpunk.com/~greck/
---------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Keeping swap in the middle of the disk
2001-01-26 19:57 ` Chris Wilson
@ 2001-01-26 19:51 ` Jos Visser
0 siblings, 0 replies; 8+ messages in thread
From: Jos Visser @ 2001-01-26 19:51 UTC (permalink / raw)
To: Chris Wilson; +Cc: linux-lvm, jakdaw
And thus it came to pass that Chris Wilson wrote:
(on Fri, Jan 26, 2001 at 07:57:13PM +0000 to be exact)
> On Fri, 26 Jan 2001, Jos Visser wrote:
>
> > Hi Chris,
> >
> > The setup you describe will work. Use pvcreate to make hda2, hda4, hdc2
> > and hdc2 into physical volumes, and group them into one volume group
> > (using vgcreate/vgextend as appropriate). Then create one big logical
> > volume in that vg.
>
> If I do this then surely it either ends up striping across all four
> partitions (so each disk would be continually seeking from one partition
> to another) or not do any striping at all?
When you put multiple PV's in a VG, it does not stripe, but it
concatenates. Depending on the locality characteristics of the file
system you are using, processing a single file usually hits one PV only,
*unless* you explicitly stripe the LV, in which case it indeed *does*
stripe across all four PV's. The setup you describe which first combines
two partitions into a concatenated metadevice, and then combine these
two as PV's in a VG would be the better approach.
On the other hand, why not create two gigantic 46GB PV's, and create
swap logical volumes as well as a ReiserFS lvol?
++Jos
>
> > However, I must say that placing the swap area's in the middle of the
> > disk strikes me as somewhat overkill. I dare venture that this is almost
>
> I guess so... it looks like I'm gonna end up with it at one end of the
> disk.
>
> > never necessary nowadays. Theoretically you are right, but the
> > things modern disk drives and operating systems do to minimise disk
> > I/O's make it kinda hard to predict what will be going on anyways.
> > Optimising swapping is optimising at the wrong level of the storage
> > hierarchy anyway. And, on another note, it might be more worthwhile to
> > make sure the ReiserFS journal is in the middle of the disk, since that
> > is most definitely a hot spot in the file system.
> >
> > ++Jos
> >
>
> Cheers,
>
> Chris
>
> --
> jakdaw@xmms.org
--
What's real, is worth it...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Keeping swap in the middle of the disk
2001-01-26 19:36 ` Jos Visser
@ 2001-01-26 19:57 ` Chris Wilson
2001-01-26 19:51 ` Jos Visser
0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2001-01-26 19:57 UTC (permalink / raw)
To: Jos Visser; +Cc: linux-lvm, jakdaw
On Fri, 26 Jan 2001, Jos Visser wrote:
> Hi Chris,
>
> The setup you describe will work. Use pvcreate to make hda2, hda4, hdc2
> and hdc2 into physical volumes, and group them into one volume group
> (using vgcreate/vgextend as appropriate). Then create one big logical
> volume in that vg.
If I do this then surely it either ends up striping across all four
partitions (so each disk would be continually seeking from one partition
to another) or not do any striping at all?
> However, I must say that placing the swap area's in the middle of the
> disk strikes me as somewhat overkill. I dare venture that this is almost
I guess so... it looks like I'm gonna end up with it at one end of the
disk.
> never necessary nowadays. Theoretically you are right, but the
> things modern disk drives and operating systems do to minimise disk
> I/O's make it kinda hard to predict what will be going on anyways.
> Optimising swapping is optimising at the wrong level of the storage
> hierarchy anyway. And, on another note, it might be more worthwhile to
> make sure the ReiserFS journal is in the middle of the disk, since that
> is most definitely a hot spot in the file system.
>
> ++Jos
>
Cheers,
Chris
--
jakdaw@xmms.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Keeping swap in the middle of the disk
2001-01-26 19:18 [linux-lvm] Keeping swap in the middle of the disk Chris Wilson
2001-01-26 19:36 ` Jos Visser
2001-01-26 19:40 ` [linux-lvm] " Greck Cannon
@ 2001-01-26 20:46 ` Nils Juergens
2 siblings, 0 replies; 8+ messages in thread
From: Nils Juergens @ 2001-01-26 20:46 UTC (permalink / raw)
To: linux-lvm
On Fri, 26.01.01, Chris Wilson <cdw22@hermes.cam.ac.uk> wrote:
>
[cut some stuff]
> Each disk is partitioned as follows:
>
> hda1 hda2 hda3 hda4
> <32 meg> <22 gig> <256 meg> <22 gig>
>
> The two drives are hda and hdc. I'd hoped it might be possible to create a
> Logical Volume from hda2 and hda4, and one from hdc2 and hdc4. Then use
> them as Physical Volumes to create an 88gig Logical Volume for my reiser
> filesystem. It would appear that I cannot do this with LVM (pvcreate
> appears to check that the devices are not logical volumes).
I suppose the hda3 and hdc3 are to be the swap devices, so all you
have to do is:
(1) turn hda2, hda4, hdc2 and hdc4 into _physical volumes_, using
partition id 8e and pvcreate, eg
"pvcreate /dev/hda2 /dev/hda4 /dev/hdc2 /dev/hdc4"
(2) create a _volume group_ out of these PV's
"pvcreate <name of VG> /dev/hda2 /dev/hda4 /dev/hdc2 /dev/hdc4"
(3) create a _logical volume_. This is where the filesystems are
put on :)
"lvcreate -n <name of LV> -L 88G /dev/<name of VG>"
(4) make filesystem
"mkreiserfs /dev/<name of VG>/<name of LV>
that should be it.
good luck,
Nils
--
> Nils Juergens | nils@muon.de | icq 7090774 <
> If we all work hard, we can turn this company <
> around 360 degrees -- gruntbert(LOTD) <
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Re: Keeping swap in the middle of the disk
2001-01-26 19:40 ` [linux-lvm] " Greck Cannon
@ 2001-01-26 21:13 ` Chris Wilson
2001-01-27 2:16 ` Greck Cannon
0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2001-01-26 21:13 UTC (permalink / raw)
To: linux-lvm; +Cc: Greck Cannon
Hi Greck,
On Fri, 26 Jan 2001, Greck Cannon wrote:
> On Fri, Jan 26, 2001 at 07:18:23PM +0000, Chris Wilson wrote:
> |
> | - Use MD to do linear append of hda2, hda4 and hdc2, hdc4 then use LVM
> | with the md0 and md1. [Not tried this - and all the different versions of
> | MD look rather scary!]
>
> This is exactly what I'm doing... well, the md part anyway. md 0.90
> (stock in 2.4, a patch in 2.2) is very robust, and easy to configure.
Where does this live? Kernel 2.4 is nowhere near stable on my SMP system
(ethernet lasts a few hours before it gives up on IRQ's). There appears to
be an alpha patch for 2.2.17 at
http://people.redhat.com/mingo/raid-patches/ and the kernel.org
pub/linux/daemons/raid/alpha is old too - neither will patch a clean
2.2.18 distribution.
> I'm using matching priorities on the swap to stripe them, and sda4 and
> sdb4 are RAID-0. Eventually I'll bind sda1 and sdb1 as RAID-0 with md
> as well, and give LVM /dev/md0 and /dev/md1 as PVs.
Let me know whether you have any success with that! If LVM is happy with
/dev/md0 as a PV then that might be the best solution for me (I could
probably do it all with MD but I like the idea of being able to add
another couple of disks down the line and add them to the same
mega-filesystem :) Course I'd have to get MD working first - what's wrong
with the MD that's included in 2.2.18? I've seen mention of 'nasties' and
'bugs' but no specifics.
> sda2 is / (just for ease of maintenance and repair) and I dunno WHAT I'm
> going to do with sdb2 yet. Maybe I'll trust md to RAID-0 sda2 and sdb2
> together as /.
>
> BTW, it's *really* nice to see someone else that still takes an interest
> in what used to be some of the basics of system performance.
:)
Chris
--
jakdaw@xmms.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [linux-lvm] Re: Keeping swap in the middle of the disk
2001-01-26 21:13 ` Chris Wilson
@ 2001-01-27 2:16 ` Greck Cannon
0 siblings, 0 replies; 8+ messages in thread
From: Greck Cannon @ 2001-01-27 2:16 UTC (permalink / raw)
To: linux-lvm; +Cc: cdw22
On Fri, Jan 26, 2001 at 09:13:08PM +0000, Chris Wilson wrote:
|
| Hi Greck,
|
| Where does this live? Kernel 2.4 is nowhere near stable on my SMP system
| (ethernet lasts a few hours before it gives up on IRQ's). There appears to
| be an alpha patch for 2.2.17 at
| http://people.redhat.com/mingo/raid-patches/ and the kernel.org
| pub/linux/daemons/raid/alpha is old too - neither will patch a clean
| 2.2.18 distribution.
Yeah, the old software RAID code in stock 2.2 is fairly evil... here's
a link to the announcement from mingo about a RAID 0.90 patch against
2.2.18:
http://marc.theaimsgroup.com/?l=linux-raid&m=97932083031328&w=2
[aside] I really like the mailing list archives here.
|
| Let me know whether you have any success with that! If LVM is happy with
| /dev/md0 as a PV then that might be the best solution for me (I could
| probably do it all with MD but I like the idea of being able to add
| another couple of disks down the line and add them to the same
| mega-filesystem :) Course I'd have to get MD working first - what's wrong
| with the MD that's included in 2.2.18? I've seen mention of 'nasties' and
| 'bugs' but no specifics.
I'll keep you posted... there's no reason I should have any issues with
it. I've actually had LVM + RAID 0.90 up and running several times on
other machines, but have inevitably run into one of the various problems
that ends in a panic, so I'm taking a vacation.
As far as "nasties" in the old RAID code, I think mostly it's just that:
OLD. RAID 0.90 has been out for a very long time now. Not exactly sure
why it hasn't been rolled into 2.2 yet, although I'm sure the linux-kernel
archives hold the answer.
--greck
--
to be bored, visit http://unpunk.com/~greck/
---------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2001-01-27 2:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-26 19:18 [linux-lvm] Keeping swap in the middle of the disk Chris Wilson
2001-01-26 19:36 ` Jos Visser
2001-01-26 19:57 ` Chris Wilson
2001-01-26 19:51 ` Jos Visser
2001-01-26 19:40 ` [linux-lvm] " Greck Cannon
2001-01-26 21:13 ` Chris Wilson
2001-01-27 2:16 ` Greck Cannon
2001-01-26 20:46 ` [linux-lvm] " Nils Juergens
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.