[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] lvm partition on ramdisk

The purpose of the ramdisk is to emulate a battery-backed solid-state drive which is intended to do high speed, seek-free metadata IO in a file system (for instance FAT32) in which all the metadata is at the beginning. We can't afford the SSD unless we know it is going to work.
We don't care if the test data survives a shutdown, only that the mapping be right.
I did try making the whole ramdisk a PV, and it choked on that too, because of "filtering". A way around all this overprotectiveness would be highly appreciated.
On 5/12/08, Stuart D. Gathman <stuart bmsi com> wrote:
On Mon, 12 May 2008, Larry Dickson wrote:

> I'm trying to set up a logical volume over a 256MB ramdisk and a 1TB raid
> array partition. My ramdisk (set up in grub.conf with ramdisk_size=262144
> ramdisk_blocksize=4096) fails to make a type 8e partition either in fdisk or
> sfdisk. The error in fdisk is

You can't and don't need to set a partition type for a ramdisk.  It
already is a partition.

> Can anyone give me some guidance here? Is it choking on the 4K blocksize? I
> wanted that for efficiency, as suggested by MrMichaelWill on his blog,
> but his base case seems to be a file system mounted directly on the
> unpartitioned device, and I need LVM.

No, just as you can make a disk device like /dev/sda a PV without any
partition table, you don't need a partition table for a ramdisk.

HOWEVER: you REALLY REALLY don't want to mix volatile and non-volatile
PVs in the same volume group.  When you reboot, and the ramdisk PV is
missing, the volume group won't activate automatically.  Furthermore,
you could accidentally end up with real data on the ramdisk - and it goes
bye bye on reboot.

Let me guess - you wanted to use the ramdisk for a snapshot?  Yes, some
other people have tried that (see the thread here a week or so ago).  You will
be very unhappy when the system reboots and the ramdisk is missing.

The real way to put snapshots on a ramdisk is a "temporary snapshot" -
a feature which could in theory be done via device-mapper, but needs
utility support.

If your root fs is not on the VG you are adding the ramdisk to, you
could probably get away with it.  Add the ramdisk, snapshot, make your
backup, delete snapshot, reduce ramdisk from VG.  If the system crashes
while the ramdisk is still in the VG metadata, then you'll need to manually
recover the VG to activate - but hopefully that will be rare.

There is also an option you could add to initrd to activate a VG even
with missing PVs.  But that makes all LVs read-only until the VG is repaired.

             Stuart D. Gathman <stuart bmsi com>
   Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

linux-lvm mailing list
linux-lvm redhat com
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]