Skip to contentSkip to conversation

Installing Linux on LVM

linux-lvm Glenn Shannon 5 participants 8 messages Aug 7, 2001 – Aug 9, 2001

lore
Share & tools
lore
#0 lore raw

Hi all!

I was wanting to install Debian onto an LVM partition. Does anyone here know if this can be done or am I going to have to try and figure it out all by my lonesome? :)

I have a bunch of experience in installing/patching LVM beta 7 and am planning on using beta 8.

Also, does anyone know of a bootloader that will recognize an LVM partition? It would be kind of wasteful if I installed linux only to have to boot from a floppy :)

Thanks in advance for any replies!

Glenn

#1 lore raw

Glenn Shannon([email protected])@Tue, Aug 07, 2001 at 10:09:26AM -0700:

Quoted 9 lines

Hi all!

I was wanting to install Debian onto an LVM partition. Does anyone here know if this can be done or am I going to have to try and figure it out all by my lonesome? :)

I have a bunch of experience in installing/patching LVM beta 7 and am planning on using beta 8.

Quoted 8 lines

Also, does anyone know of a bootloader that will recognize an LVM partition? It would be kind of wasteful if I installed linux only to have to boot from a floppy :)

Thanks in advance for any replies!

Glenn

The docs are out there, but the information on this topic isn't explicit or abundant. What you're asking about is installing root on LVM, if I understood your request correctly.

In general terms, these are the steps:

1. Create a boot partition and swap not on the LVM. This will be permanent.
2. Create a minimal installation on a small partition (regular ext2). This will not be permanent, so no need to be elaborate.
3. Compile a kernel that has support for LVM and your choice of fs and ext2 statically linked.
4. Create your logical volumes, etc. on the rest of the disk space.
5. Use lvmcreate_initrd to create an initrd so the kernel will be able to find everything in the new root lv.
6. Use debootstrap to create an installation on the new root. This is not smooth, and does not run through normal style installation scripts. You will most likely have to use chroot and dpkg to get the locales package installed for debootstrap to even complete successfully. You'll want to copy some of the things from /etc/ and check them out. fstab and lilo.conf will need to be modified. A lot of little steps here just making sure that you can boot, and can get to your source of debian packages.
(at this point you can run dpkg/apt and install a _lot_ of stuff before you reboot. But be careful, symlinks won't necessarily point where you think they do.)
7. Run lilo with your new config and reboot.
8. Fix the details you overlooked in step 6 :)
9. Finish selecting packages and installing.
10.Thank the debian maintainer for making normal installations so easy (Something I thought I'd never say! :).
11. If desired, incorporate the disk space for the original install into your lv.

I regret not writing down details of the process while doing it. I was playing it by ear, and my original install was complete and had important data that I wanted to be extremely careful with. The pace was slow and easy.

I was using 2.4.7-pre3 with the latest patches at that time, devfs (with no devfsd), and have had to work through a lot, but learned quite a bit (my main reason for doing this). Manual installation and going without devfsd were more difficult than any of the issues with LVM. Most of the difficulties are overcome by reading docs, and being alert to the error messages and other "progress indicators".

Have fun!

Wade Curry wcurry(AT)cts.com

Do I have to compile it?            Looking for a position
No, I *get* to compile it.          working with *nix as a
It's about freedom.                 Sys. Admin. or other.
#2 lore raw

Hi there and thanks for the info!

What I did last time was:
Install to a normal partition all on one partition (only partition created was /) (bad form I know but it was temp only)... installed the sources for the 2.4.7 kernel, patched to LVM beta 7 and installed the beta7 tools.

Compiled the kernel.

Went back and fixed the get_hardsect problem.

Compiled kernel again.

Went back and fixed the other get_hardsect problem.

Compiled kernel again.

Put it on a small partition which would be called /boot on the new LVM.

Made my LVs and created actual partitions.

tar -c|tar -x'ed the directories to their new reiserfs partitions (is it just me or do files take up a chunk more space on reiser?....) on the LVM.

Set up lilo.conf and ran lilo.

Re-setup lilo.conf compensating for devfs entries (I can't get fricken devfsd to make me my compatibility links) and re-ran lilo.

Rebooted.

Rebooted back to old install and ran lvmcreate_initrd.

Added initrd statement to lilo.conf and re-ran lilo.

Rebooted.

Booted into LVMed Debian.(yay!)

So all told I have been there done that already.. what my real question was is if there is any way to get Debian (or any linux really) to install straight into an LVM without the aforementioned steps above? Or would I need to create my own bootfloppy/installation system?

Anyhow thanks for the info on your experience!

Glenn

----- Original Message -----
From: "Wade Curry" <[email protected]>
To: <[email protected]>
Sent: Tuesday, August 07, 2001 10:54 AM
Subject: Re: [linux-lvm] Installing Linux on LVM

Quoted 4 lines

Glenn Shannon([email protected])@Tue, Aug 07, 2001 at 10:09:26AM -0700:

Quoted 3 lines

Hi all!

I was wanting to install Debian onto an LVM partition. Does anyone here

know

Quoted 1 line
Quoted 1 line

if this can be done or am I going to have to try and figure it out all

by my

Quoted 6 lines
Quoted 6 lines

lonesome? :)

I have a bunch of experience in installing/patching LVM beta 7 and am planning on using beta 8.

Also, does anyone know of a bootloader that will recognize an LVM

partition?

Quoted 1 line
Quoted 1 line

It would be kind of wasteful if I installed linux only to have to boot

from

Quoted 68 lines
Quoted 6 lines

a floppy :)

Thanks in advance for any replies!

Glenn

The docs are out there, but the information on this topic isn't explicit or abundant. What you're asking about is installing root on LVM, if I understood your request correctly.

In general terms, these are the steps:

1. Create a boot partition and swap not on the LVM. This will be permanent.
2. Create a minimal installation on a small partition (regular ext2). This will not be permanent, so no need to be elaborate.
3. Compile a kernel that has support for LVM and your choice of fs and ext2 statically linked.
4. Create your logical volumes, etc. on the rest of the disk space.
5. Use lvmcreate_initrd to create an initrd so the kernel will be able to find everything in the new root lv.
6. Use debootstrap to create an installation on the new root. This is not smooth, and does not run through normal style installation scripts. You will most likely have to use chroot and dpkg to get the locales package installed for debootstrap to even complete successfully. You'll want to copy some of the things from /etc/ and check them out. fstab and lilo.conf will need to be modified. A lot of little steps here just making sure that you can boot, and can get to your source of debian packages.
(at this point you can run dpkg/apt and install a _lot_ of stuff before you reboot. But be careful, symlinks won't necessarily point where you think they do.)
7. Run lilo with your new config and reboot.
8. Fix the details you overlooked in step 6 :)
9. Finish selecting packages and installing.
10.Thank the debian maintainer for making normal installations so easy (Something I thought I'd never say! :).
11. If desired, incorporate the disk space for the original install into your lv.

I regret not writing down details of the process while doing it. I was playing it by ear, and my original install was complete and had important data that I wanted to be extremely careful with. The pace was slow and easy.

I was using 2.4.7-pre3 with the latest patches at that time, devfs (with no devfsd), and have had to work through a lot, but learned quite a bit (my main reason for doing this). Manual installation and going without devfsd were more difficult than any of the issues with LVM. Most of the difficulties are overcome by reading docs, and being alert to the error messages and other "progress indicators".

Have fun!

Wade Curry wcurry(AT)cts.com

Do I have to compile it?            Looking for a position
No, I *get* to compile it.          working with *nix as a
It's about freedom.                 Sys. Admin. or other.

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

#3 lore raw

Glenn Shannon([email protected])@Tue, Aug 07, 2001 at 11:45:19AM -0700:

Quoted 4 lines

Hi there and thanks for the info!

What I did last time was:
Install to a normal partition all on one partition (only partition created

--snip---

Quoted 10 lines

Booted into LVMed Debian.(yay!)

So all told I have been there done that already.. what my real question was is if there is any way to get Debian (or any linux really) to install straight into an LVM without the aforementioned steps above? Or would I need to create my own bootfloppy/installation system?

Anyhow thanks for the info on your experience!

Ah well, you're welcome. Sorry it's not the information you were after. I don't know of any boot floppies (official or not) for any distro that does that. I honestly don't expect to see it for a while, either. I don't mean to be just pessimistic. Someone on this list (Hienz I think) said that boot-time recognition of logical volumes is a feature to be added _after_ 1.0. Doesn't seem quite worth the effort to work out all the logistics of initrds and whatnot in the boot disks, if we can hold off for that functionality just a bit. In the meantime the few of us who want to explore, are already having success with the current scheme of things. Just doesn't seem that there is as much pressure to create that functionality as there would be if new boot floppies were absolutely necessary.

Gonna wait it out :)

Wade Curry wcurry(AT)cts.com

The industry doesn't want [MP3] pushed, and Microsoft and RealNetworks don't want it pushed. The consumer is going to eat what he's given.
- David Farber, FCC

#7 lore raw
In reply to Glenn Shannon
Quoted 3 lines · Glenn Shannon

is if there is any way to get Debian (or any linux really) to install straight into an LVM without the aforementioned steps above? Or would I need to create my own bootfloppy/installation system?

These are just my thoughts; I'm running a couple of root-on-LVM Debian systems, but I got there by cloning exiting systems. Here's how I would attack a fresh install:

Replace the kernel on the rescue floppy (there are instructions on the disk on how to do this) with a kernel that includes the LVM patch. Start the install and partition the disk, switch to an alternate console and create and activate any LVM volumes you want. Since the LVM tools (pvcreate, vgscan, etc.) aren't on the boot-floppies, you will need to get them onto the system some other way - perhaps another floppy.

The boot-floppies initial ramdisk might be too small for the files vgscan creates in /etc. If so, create another ramdisk for /etc.

Switching back to the installer console, the LVM volumes may automagically show up in the list of partitions. Failing that, go back to the alternate console, make filesystems on the LVM volumes and mount them under /target.

The rest of the install *might* then proceed normally ...

But, unless you genuinely enjoy - as I do - booting linux from a lilo floppy with an initrd and linuxrc=/bin/sh to work past hiccups, it's probably easier to install onto a borrowed disk and copy the entire system onto your LVM volumes afterwards.

I don't think direct support for LVM will appear in the Debian installer until LVM auto-detect makes it into the kernel.

Regards,

Mark.

#4 lore raw
In reply to Wade Curry
Quoted 4 lines · Wade Curry

Ah well, you're welcome. Sorry it's not the information you were after. I don't know of any boot floppies (official or not) for any distro that does that. I honestly don't expect to see it for a while, either.

Gentoo (www.gentoo.org) has support in their install system for LVM as root. Of course, it's not a full GUI installation tool or anything, but you can do it. :)

Just be warned, gentoo is definitely still in development. I have it on all my systems, but I don't know that I would call it "production ready". If you're a home user with good backups, or have a spare computer lying around that you use to test stuff though, or if you're just really daring, give it a try. I think you'll like it. ;)

Oh yeah, and all this is my opinion, and not the opinion of my employer. And all that legal mumbo jumbo...and stuff.

Regards,

Signature · 16 lines
AJ Lewis
Sistina Software Inc.                  Voice:  612-638-0500
1313 5th St SE, Suite 111              Fax:    612-638-0500
Minneapolis, MN 55414                  E-Mail: [email protected]
http://www.sistina.com

Current GPG fingerprint = 3B5F 6011 5216 76A5 2F6B  52A0 941E 1261 0029 2648
Get my key at: http://www.sistina.com/~lewis/gpgkey
 (Unfortunately, the PKS-type keyservers do not work with multiple sub-keys)

-----Begin Obligatory Humorous Quote----------------------------------------
Sometimes I have a difficult time handling myself in social situations.
I just start scampering around neurotically, frantically jumping all
over guests. I think it all goes back to when I was raised in the wild
by miniature schnauzers.
-----End Obligatory Humorous Quote------------------------------------------
#6 lore raw
In reply to Wade Curry

Hi.

Quoted 2 lines

So all told I have been there done that already.. what my real question was is if there is any way to get Debian (or any linux really) to install

Suse installs on lvm (but not on raid 0.90) at least since 1999. (maybe off
topic: The latest suse version 7.2, says that can be installed on encrypted
fs. I can't test it because i only have the ftp version)

Quoted 2 lines

straight into an LVM without the aforementioned steps above? Or would I need to create my own bootfloppy/installation system?

Regards,
Muralito.

#5 lore raw
In reply to AJ Lewis

Interesting.

I'll take a look at it and see if I can't get a similar method like the one they use to work with Debian.

If I have any successes I'll let the list know :)

Thanks!

Glenn
----- Original Message -----
From: "AJ Lewis" <[email protected]>
To: <[email protected]>
Sent: Wednesday, August 08, 2001 8:31 PM
Subject: Re: [linux-lvm] Installing Linux on LVM