Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LVM install with slack9?

4 views
Skip to first unread message

David Moylan

unread,
Aug 16, 2003, 7:39:19 PM8/16/03
to
has anyone done a fresh install on a machine with slack9 and LVM?
i would like to do an install from scratch totally using LVM.

is there enough/any support on the install disk to enable LVM or
should i begin rolling my own install images?

cheers, Wiz!!

Simon

unread,
Aug 17, 2003, 7:02:13 AM8/17/03
to
On Sat, 16 Aug 2003 23:39:19 GMT, David Moylan <w...@NOSPAMwiz.net.au> wrote:
> is there enough/any support on the install disk to enable LVM or
> should i begin rolling my own install images?

The bare.i kernel supports LVM, but I don't yet know what support for
LVM is required in the setup scripts (I haven't done much Googling for
LVM yet) or what support there currently is.

If I were you, I'd Google for how to set up LVM & then check whether
the setup scripts for Slackware do any of that. If not, you'll have to
roll your own.


--
Simon <si...@no-dns-yet.org.uk> **** GPG: F4A23C69
"We demand rigidly defined areas of doubt and uncertainty."
- Douglas Adams

Stefan Patric

unread,
Aug 17, 2003, 5:37:34 PM8/17/03
to

I thought of doing the same when I acquired 9.0, but all the
literature, HOWTOs, and such are all for setting up LVM AFTER a
typical install, that is, standard Primary or Logical partitioning.

From what little checking I've done, setting up LVM on a fresh install
is not possible with Slackware's standard install CD, which installs
a minimal Linux system on a RAM disk -- only what is needed to
partition, install and config a STANDARD Linux system. A lot of stuff
is missing, of course. The main things missing are all the specific
LVM commands to set it up and configure. If one were to create a
custom install disk, that included those LVM specific commands, along
with the standard Slackware archives, then you could set up LVM from
a scratch install, since LVM support is already included in the
bare.i kernel.

Perhaps, instead of a custom install disk, you could try to exact from
the archives just those LVM commands needed and install them on the
RAM disk. I haven't checked into this. Just a thought.

When you consider all the work involved to do this, it might be more
time effective to just do a standard install, and THEN set up LVM,
unless your intention is to create your own default LVM Linux distro.
;-)

--
Stefan Patric
too...@yahoo.com

Wong Kum Weng

unread,
Aug 18, 2003, 11:30:39 PM8/18/03
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I've been using LVM support since 2.4.18 kernel on slackware. Yes, bare.i
come with LVM support. The following was what i did to set up the
slackware with LVM support on my Compaq Evo800v notebook.

1. During the fdisk/cfdisk, I will only create the root(/) partition
with about 150mb of space. and that's for Ext3 support, (if you want to
use ReiserFS you have to calculate the actual size by adding another 32Mb.
Read the manual on this.) I would also create a swap partition 2 times my
Physical Ram size. Lastly, I will create a LVM partition for the rest of
my harddrive. So I will get /dev/hda1 for (/), /dev/hda2 for swap and
/dev/hda3 for lvm.
2. Next, during the installation of the packages, I will only setup
packages i will required for my system in dir a/ of the cdrom and will
choose to setup lvm packages which resides in dir ap/ . Because the lvm
partition was not setup yet, so we have to install the minimal set of
packages due to disk space constraint. The rest of the installation
process is as normal.
3. After the reboot, this is when I start to setup LVM.

# vgscan /* To update the lvm table though it's null, just do it.

# pvcreate /dev/hda3 /* To create the physical volume of the harddisk.

# pvscan /* it should show you the new pv that was created.

# vgcreate -s 4m vg00 /dev/hda3 /* the -s option defines the physical
extend size, please read the manual on the defination, I use 4mb because
my notebook will create the default size as 32m which is too big.

# vgdisplay /* you should see the cewly created volume group.

# lvcreate -l 512 -n lvol1 /dev/vg00 /* creating a new logical volume
/* plan and create enough lv.

# for x in (x=1;x<5;x++) ; do mkfs.ext3 /dev/vg00/lvol$x ; done
/* a simple script i used to mkfs on the LVs.

# init 1

# mount /dev/vg00/lvol1 /mnt/hd

#mv /usr/* /mnt/hd /* moving all files and directories in /usr to
lvol1

# umount /mnt/hd

#mount /dev/vg00/lvol1 /usr /* /usr back in action. Repeat the steps
for the partition you plan for LVM.

** REMEMBER TO EDIT YOUR /etc/fstab **

then reboot and you should have your systems with lvm up and running.
Unfortunately, not the extire distro can have it on LVM. at least the (/)
have to reside on normal slice. It should be able to in future if we are
able to setup lvm from the installation CD before installing any packages.

Hope this help.

Andrew Wong.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/QZnrmSPlL4jR0xERAm2OAKCWa3x+eik+S8NZ1aQ4CZFzkXpeuwCgpgoK
7I1sOC/jWzwbPPPO8waqr+s=
=trhi
-----END PGP SIGNATURE-----

Chris Marshall

unread,
Aug 19, 2003, 9:07:33 AM8/19/03
to
Wong Kum Weng <jin...@bigfoot.com> wrote in message news:<Pine.LNX.4.56.03...@labyrinth.systemscrafter.com>...

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> I've been using LVM support since 2.4.18 kernel on slackware. Yes, bare.i
> come with LVM support. The following was what i did to set up the
> slackware with LVM support on my Compaq Evo800v notebook.
>
> 1. During the fdisk/cfdisk, I will only create the root(/) partition
> with about 150mb of space. and that's for Ext3 support, (if you want to
> use ReiserFS you have to calculate the actual size by adding another 32Mb.
> Read the manual on this.) I would also create a swap partition 2 times my
> Physical Ram size. Lastly, I will create a LVM partition for the rest of
> my harddrive. So I will get /dev/hda1 for (/), /dev/hda2 for swap and
> /dev/hda3 for lvm.
...
> >
> > cheers, Wiz!!
> >
> >


This is basically what I have done, although I have done it a little
differently and I would describe it a little differently also.

I would setup my partition table like this:

24M boot
128M swap (assuming you have 128M of memory)
200M rescue
extended partition to cover the rest of the disk
5G LVM
5G LVM
...
<5G LVM (to include the last little bit of space on the drive)

The main difference here is that I break the bulk of the hard drive
into 5 GB LVM partitions instead of one big LVM partition. This would
allow you to set up non-LVM partitions in the future if you needed to
for some reason.

I format the "rescue" and boot partitions as ext2. I install the "a"
series only into rescue from the install CD then reboot into it. Then
I mount the slackware cd at /mnt/cdrom and installpkg
ap/lvm-1.0.6-i386-1.tgz
d/binutils-2.13.90.0.18-i386-1
The reason for installing binutils is that to boot into a root
filesystem on a logical volume, you need to run lvmcreate_initrd to
create an initrd for the kernel to load first before it can mount such
a filesystem. lvmcreate_initrd needs the "strip" program, which is in
the binutils package.

So, once you are booted into rescue, you run
pvcreate /dev/hda5
pvcreate /dev/hda6
pvcreate /dev/hda6
...
until you have initialized all of the lvm partitions. Then you run
vgcreate vg00 /dev/hda5 /dev/hda6 ...
to create the volume group. Then you create a logical volume for your
root partition. Then run mkresierfs on it. Then mount it somewhere,
like /mnt/root1. Then, run a script like this to install all of the
slackware packages into it:

export ROOT=/mnt/root1
cd /mnt/cdrom/slackware

series="a ap d e f gnome k kde l n t tcl x xap y"
aaa_base="aaa_base-9.0.0-noarch-1.tgz"

installpkg -root $ROOT a/$aaa_base

for dset in $series; do
cd $dset
packages=*.tgz
for pkg in $packages; do
if [ $pkg != "$aaa_base" ] ; then
echo "installing $pkg"
installpkg -root $ROOT $pkg
else
echo "skipping $pkg"
fi
done
cd ..
done

Actually, you would probably have to remove kde and gnome from this
list since it wouldn't fit on a single CD with all of the other disk
sets. After your first reboot into the lvm root, you can put CD 2 in,
and run install-packages from the kde and gnome directories. Then run
pkgtool again to select your desktop (kde or gnome or one of the
others).

Anyway, you've just finished running the above script. Then run
"chroot /mnt/root1 ldconfig" or you won't be able to run any other
commands in your new lvm based root partition. ldconfig creates all of
the symbolic links to shared and static libraries on your system and
until it is run the first time, you won't be able to load any
programs.

Now, at this point, you can run commands from the new partition with
chroot. You are almost done except you have to run the slackware
configuration scripts.

run this: chroot /mnt/root1 pkgtool

From inside the pkgtool, run all of the initialization scripts.

Now, you need to create a lilo.conf and run lilo on it so you can
boot into your lvm based root partition, and you need to create an
fstab and put it in /mnt/root1/etc/fstab.

Your lilo.conf can look like this:

boot = /dev/hda
prompt
timeout = 100

image = /boot/vmlinuz
root = /dev/hda3
label = rescue
read-only

image = /boot/vmlinuz
initrd = /boot/initrd-lvm-2.4.20.gz
root = /dev/vg00/lv_root1
label = root1
read-only

As you can see, I've named my volume group vg00 and my logical volume
lv_root1.

See /usr/doc/Linux-HOWTOs/LVM-HOWTO for more detail on how the lvm
commands work. It is very well written and contains many receipes for
different situations.

Chris Marshall

Stefan Patric

unread,
Aug 19, 2003, 9:10:14 PM8/19/03
to

> [snip]

Since the Slackware install is run from a minimal RAMdisk based set up
with root priviledges, wouldn't it be possible, given a sufficiently
sized RAMdisk (I don't know how big it really is. A few megs? Will
have to check.), to install the above two packages in the RAMdisk,
create all your LVM groups and volumes on the hard drive, and lastly
run 'setup' as you normally would to install the system? Certainly
would be a whole lot easier than how you and Wong had to do it.

I've got a 300MHz AMD test machine with 256MB of RAM. Think, I'll
give it a try and see if it works.

--
Stefan Patric
too...@yahoo.com

Chris Marshall

unread,
Aug 20, 2003, 11:53:41 AM8/20/03
to
Stefan Patric <too...@yahoo.com> wrote in message news:<4Wz0b.11104$nf3.269@fed1read07>...

> Since the Slackware install is run from a minimal RAMdisk based set up
> with root priviledges, wouldn't it be possible, given a sufficiently
> sized RAMdisk (I don't know how big it really is. A few megs? Will
> have to check.), to install the above two packages in the RAMdisk,
> create all your LVM groups and volumes on the hard drive, and lastly
> run 'setup' as you normally would to install the system? Certainly
> would be a whole lot easier than how you and Wong had to do it.
>
> I've got a 300MHz AMD test machine with 256MB of RAM. Think, I'll
> give it a try and see if it works.

I think you are correct on all counts. At first I thought you would
have a hard time fitting all of the lvm utilities into a reasonably
sized installtion root filesystem, but they are not that large
themselves and I think they mostly link against the standard C
library, /lib/lib-2.3.1.so, which is only around 1.4M itself.

I would be interested to hear if your experiment works.

Chris Marshall

Chris Marshall

unread,
Aug 20, 2003, 1:38:54 PM8/20/03
to
Stefan Patric <too...@yahoo.com> wrote in message news:<4Wz0b.11104$nf3.269@fed1read07>...
> Since the Slackware install is run from a minimal RAMdisk based set up
> with root priviledges, wouldn't it be possible, given a sufficiently
> sized RAMdisk (I don't know how big it really is. A few megs? Will
> have to check.), to install the above two packages in the RAMdisk,
> create all your LVM groups and volumes on the hard drive, and lastly
> run 'setup' as you normally would to install the system? Certainly
> would be a whole lot easier than how you and Wong had to do it.
>
> I've got a 300MHz AMD test machine with 256MB of RAM. Think, I'll
> give it a try and see if it works.

O.K. I gave it a shot.

I took install.1 and install.2 from rootdisks, and did this:

gzip -dc install.1 > file1
gzip -dc install.2 > file2
cat file1 file2 > file
mkdir mnt
mount file mnt -o loop
installpkg -root mnt /(blah blah)/slackware/ap/lvm(blah blah).tgz
umount mnt
dd if=file of=file1 bs=1024 count=3000
dd if=file of=file2 bs=1024 count=6114

Then I took file1 and file2 and gzipped them, than used dd and cat to
pad enough zeros on the end to exactly fill a floppy to get my two
root images. I copied them to floppies and attempted to boot from
them.

I got through the boot disk (unchanged from slack9.0) and my
install.1, but I got an error message on install.2 about a bad tar
header.

Um, I just figured it out as I was typing this.

the second install.2 image is not a gzipped part of an ext filesystem
image. It is a gzipped tar archive that is somehow untarred into the
root filesystem. I guess the kernel does that. I had assumed the
kernel took however many disks you threw at it and unzipped them in a
ram disk, then mounted the ram disk.

Apparently, it takes the first disk and unzipps it into the ram disk,
then mounts it, and I'll bet Patrick, in one of his init scripts in
that ram disk, prompts you for a second floppy, then untars it into /.

O.K. I see what needs to be done now. I'll report tomorrow.

You learn something new every day.

Chris Marshall

/dev/rob0

unread,
Aug 20, 2003, 2:29:34 PM8/20/03
to
In article <d06acab6.03082...@posting.google.com>,

Chris Marshall wrote:
> Um, I just figured it out as I was typing this.

:)

> the second install.2 image is not a gzipped part of an ext filesystem
> image. It is a gzipped tar archive

Yes ...

> that is somehow untarred into the
> root filesystem. I guess the kernel does that. I had assumed the

... no, the init scripts in the ramdisk (on install.1).

> kernel took however many disks you threw at it and unzipped them in a
> ram disk, then mounted the ram disk.

That's how it works for *uncompressed* ramdisk images, which is what was
done in 8.1, "the release with all those rootdisks." :) Pat figured out
a better way for 9.0 (and luckily for users of 8.1, the new way is
backward-compatible.)

> You learn something new every day.

Good for you. Good luck and have fun. :)
--
/dev/rob0 - preferred_email=i$((28*28+28))@softhome.net
or put "not-spam" or "/dev/rob0" in Subject header to reply

Stefan Patric

unread,
Aug 21, 2003, 12:29:41 AM8/21/03
to

Did a quick boot from my 9.0 Install CD, and it appears that the
RAMdisk is 6MB total with about 4.5 to 5 megs used, which seems about
right, since the Slackware install minimum is 16MB -- 6 for the
RAMdisk and 10 for workspace. I quickly looked for the rc script
that sets up the RAMdisk to verify the size, but couldn't find it.
Although, I wasn't all that thorough. Didn't have the time to
calculate how much space the LVM files will consume either. (When
you are up at 5:30 AM, bedtime comes early.) Will have to wait 'til
the weekend.

Will keep the group aprised.

--
Stefan Patric
too...@yahoo.com

Wong Kum Weng

unread,
Aug 21, 2003, 11:41:52 AM8/21/03
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Thank you for taking the time to share with us.
I'll give it a shot too this weekend.

cheers and good luck to all!

Regards,
Wong Kum Weng
Linux Registered User #313736
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/ROhEmSPlL4jR0xERAsm4AKC1hKgXdL4Nf2Fex9RhkJMf462ylgCcDz7J
ByWnt+IEfYSxNPExfv0bqcI=
=p/RF
-----END PGP SIGNATURE-----

Chris Marshall

unread,
Aug 21, 2003, 1:49:55 PM8/21/03
to
Stefan Patric <too...@yahoo.com> wrote in message news:<dXX0b.11721$nf3.8091@fed1read07>...

>
> Did a quick boot from my 9.0 Install CD, and it appears that the
> RAMdisk is 6MB total with about 4.5 to 5 megs used, which seems about
> right, since the Slackware install minimum is 16MB -- 6 for the
> RAMdisk and 10 for workspace. I quickly looked for the rc script
> that sets up the RAMdisk to verify the size, but couldn't find it.
> Although, I wasn't all that thorough. Didn't have the time to
> calculate how much space the LVM files will consume either. (When
> you are up at 5:30 AM, bedtime comes early.) Will have to wait 'til
> the weekend.
>
> Will keep the group aprised.

I did another experiment myself.

just install lvm_blah_blah.tgz into an empty directory, then tar it
and put the result on a floppy.

Just to be pedantic about it:

mkdir tmp
installpkg -root tmp lvm_blah_blah.tgz
cd tmp
tar c * > ../lvm.tar
cd ..
mount /dev/fd0 /mnt/floppy
cp lvm.tar /mnt/floppy
umount /dev/fd0

Then, use the normal slack 9.0 boot, root1 and root2 disks. Once
logged in to the ram disk, untar lvm.tar into the root directory in
the ram disk.

cd /
mount /dev/fd0 /mnt
tar x /mnt/lvm.tar
umount /mnt

At this point you can type lvm commands to your heart's content. I
typed a few and they seemed to work. This needs a full run to shake
out any other bugs.

The remaining issues are then:
getting the lvm created initrd in position and getting lilo
configured to point to it.
seeing if the slackware setup scripts will let you refer to a hard
disk partition like /dev/vg00/lv_root.
expanding the size of the ram disk used by the slackware install to
accomodate the additional lvm program files.

I am guessing they won't have a big problem with it and if they did it
could be easily fixed. I am also guessing you can chroot from the
install ramdisk onto the new system to handle the lilo configuration
yourself, and that that is also how the setup scripts themselves
manage lilo setup.

In summary, you hardly have to modify the default slackware install
disks at all to pull this off. Another testament to the generality of
Patrick's script design and of linux itself.

Chris Marshall

Stefan Patric

unread,
Aug 22, 2003, 4:49:53 PM8/22/03
to

So, you're trying to set up a fresh install with LVM using floppy
disks and not the install CDs? My intent is to do this with just the
CDs. And without making any "special" partitions on the hard drive
to hold files. And if successful, write a shell script to automate
the whole process, so anyone -- even one with little Linux knowledge
or expertise, like me -- can install Slackware on LVM partitions with
only limited input needed from the user.


> The remaining issues are then:
> getting the lvm created initrd in position and getting lilo
> configured to point to it.
> seeing if the slackware setup scripts will let you refer to a
> hard
> disk partition like /dev/vg00/lv_root.
> expanding the size of the ram disk used by the slackware install
> to
> accomodate the additional lvm program files.

I hope to do this without having to increase the size of the default
RAM disk, which is 6464 KB. (Verified. Found the setting on the CD
in isolinux/isolinux.cfg. This is the file you see, where you choose
which kernel to boot with for the install/rescue RAM disk system.)

I thought of expanding the primary RAM disk, too, but think you can do
this simply by creating another RAM disk to hold the additional
files, and, then, either do a symlink to it or just add it to the
PATH. Actually, the files really needed from the LVM and binutils
archives to set up the hard drive are few and quite small. (The vast
majority of the stuff is docs, mans, and utilities not needed for the
set up phase.)

Once the archives are uncompressed to another RAM disk, the files just
might easily fit in the root RAM disk. However, I'm concerned
somewhat that there won't be enough space left over to accomodate
temporary files, if any, during the actual Slackware install. Guess,
I'll find out the hard way. ;-)


> I am guessing they won't have a big problem with it and if they did
> it
> could be easily fixed. I am also guessing you can chroot from the
> install ramdisk onto the new system to handle the lilo configuration
> yourself, and that that is also how the setup scripts themselves
> manage lilo setup.

This would be an option, if my senerio doesn't pan out.

> In summary, you hardly have to modify the default slackware install
> disks at all to pull this off. Another testament to the generality
> of Patrick's script design and of linux itself.

Agreed. Everything is very generic and straight forward. The KISS
principal, most times, is always the best solution.

Wish me luck. I start "putzing" tonight.

--
Stefan Patric
too...@yahoo.com

Martin Hughes

unread,
Aug 26, 2003, 9:16:21 AM8/26/03
to
"Stefan Patric" <too...@yahoo.com> wrote in message
news:kov1b.13056$nf3.6633@fed1read07...

> Agreed. Everything is very generic and straight forward. The KISS
> principal, most times, is always the best solution.
>
> Wish me luck. I start "putzing" tonight.

Based on my use of HP-UX and lvm (the commands look very similar anyway) the
only non-lvm filesystem which you should need to create is /boot (the one
which contains the kernel image). All the rest (including /) can be logical
volumes formatted with whichever filesystem you want to use and have
compiled into the kernel. HP-UX also uses a ramdisk to perform the initial
minimal install. If anybody has managed to create/install a similar setup
under slackware I will be interested.

--
Regards
Martin Hughes
Linux User #283064
Blessed are those who expect nothing; for they shall not be disappointed.


0 new messages