Discussion:
LVM howto
(too old to reply)
Clark Smith
2018-07-05 14:55:21 UTC
Permalink
Raw Message
I am about to embark on a project consisting of getting two hard
drives to appear under Linux as a single hard drive, with a total storage
roughly corresponding to the sum of both. I understand that the way to do
is either by means of LVM or else RAID. For my very modest needs, LVM
seems to be appropriate.

The thing is, there are lots of LVM howtos online. Maybe too
many, which makes it time-consuming to separate the wheat from the chaff.
With this in mind, what I am asking from this forum is for
recommendations on what LVM howto(s) to peruse, especially with a view to
doing the deed in Slackware.
Eef Hartman
2018-07-05 15:53:50 UTC
Permalink
Raw Message
Post by Clark Smith
I am about to embark on a project consisting of getting two hard
drives to appear under Linux as a single hard drive, with a total storage
roughly corresponding to the sum of both. I understand that the way to do
is either by means of LVM or else RAID. For my very modest needs, LVM
seems to be appropriate.
In short:
1) on your boot disk, create a small partition for /boot (must not be
under LVM)
2) the rest of that disk and all other disks can be a single partition
3) use pvcreate to create "physical volumes" for all those partitions
(except the one for /boot, of course)
4) vgcreate a volume group consisting of all those pv's (probably
two in your case).
BTW: you can later add another disk to the system and the vg,
if you'd like to
5) now create logical volumes with lvcreate (which will take the place
of hard partitions) in that vg
You can create only 1, but mostly it is more flexible to create
several as you always resize them afterwards.
Leave yet unneeded space UNassigned to those lv's, so that when
needed you can extend those lv's
Note: swap CAN be an lv as far as I know
An often used scheme is to create an lv for /, for swap and for
/home, but your milage may vary.
6) now, with /, /boot and the others mounted on the places you want
them, install your system.
Don't forget to create an initial ram disk if / is under LVM,
because otherwise the kernel cannot access the lvm.conf

It is often usefull to keep a copy of the lvm.conf and /etc/fstab
under /boot, so you can access them from a live system if you want to
make changes.
Rich
2018-07-05 15:55:31 UTC
Permalink
Raw Message
Post by Clark Smith
I am about to embark on a project consisting of getting two
hard drives to appear under Linux as a single hard drive, with a
total storage roughly corresponding to the sum of both. I understand
that the way to do is either by means of LVM or else RAID. For my
very modest needs, LVM seems to be appropriate.
Both RAID and LVM2 (it is LVM2 that is in current Linux kernels) will
do this, however LVM2 will give you the ability to slice that net
double space virtual drive into multiple other drives for use, RAID
will just give you "one big disk". Which is an advantage in favor of
LVM2.

Do note however that this mode of usage means that you will be at
higher risk of drive failure (any one disk fails, all the data on the
"sum" disk is gone). So having a backup stragety is important if this
drive will contain anything you wish to survive over a disk failure.
Post by Clark Smith
The thing is, there are lots of LVM howtos online. Maybe too
many, which makes it time-consuming to separate the wheat from the
chaff. With this in mind, what I am asking from this forum is for
recommendations on what LVM howto(s) to peruse, especially with a
view to doing the deed in Slackware.
I don't have a particular howto suggestion, but there is something you
can do ahead of time. You can practice with a set of virtual disk
files and see which howto makes the most sense to you.

You'll need to be root to do step 2:

1) Use dd to create two empty files 1G files:

dd if=/dev/zero of=/tmp/rawdisk1 bs=1024 count=1 seek=1M
dd if=/dev/zero of=/tmp/rawdisk2 bs=1024 count=1 seek=1M

2) Next, use the loopback feature of the kernel to attach a device to
each file:

losetup -f --show /tmp/rawdisk1
losetup -f --show /tmp/rawdisk2

Each losetup above will output a device name (something that will look
like '/dev/loop0'). Keep track of those device names. You can now use
these device names to experiment with LVM2 as if those devices were
real disks. So you can tryout a howto you find online, and see if it
works for you to follow it.

When you are done, shutdown any experimental LVM2 using the loopback
devices. Then undo the loopback devices first (below I assume you
received /dev/loop0 and /dev/loop1 from #2 above, adjust to match what
you actually got in #2):

losetup -d /dev/loop0
losetup -d /dev/loop1

Then you can delete the two temp files.

If you forget which 'loop#' device is which, you can run 'losetup -a'
and it will list out the loop# devices and to which file they are
attached.

The advantage of the above is you can experiment, and learn, until you
feel comfortable, without worrying about breaking anything in the
process (or if you do break something, you can just undo/redo the
creation and start again).
Grant Taylor
2018-07-05 17:18:58 UTC
Permalink
Raw Message
I am about to embark on a project consisting of getting two hard drives
to appear under Linux as a single hard drive, with a total storage
roughly corresponding to the sum of both. I understand that the way to
do is either by means of LVM or else RAID. For my very modest needs,
LVM seems to be appropriate.
You can also accomplish the same broad functionality with ZFS.

Be aware that you are putting your data at more risk because the
availability of data now depends on all of the drives. One drive going
offline very likely means that the rest of the data will be in accessible.

This is collectively known as Just a Bunch Of Disks (a.k.a. J.B.O.D.).
RAID (0), LVM, and ZFS can easily implement J.B.O.D. I'm sure there are
other ways to do it.
--
Grant. . . .
unix || die
jrg
2018-07-05 23:01:13 UTC
Permalink
Raw Message
Post by Grant Taylor
in accessible.
you're a linux user - you should know what that space does...
--
Jeff G.
I'm supposed to respect my elders, but it’s getting harder and harder
for me to find one now.
Grant Taylor
2018-07-05 23:11:52 UTC
Permalink
Raw Message
Post by jrg
you're a linux user - you should know what that space does...
:-P

Typing in an MUA is different than typing on the command line. ;-)
--
Grant. . . .
unix || die
Dan C
2018-07-06 01:28:57 UTC
Permalink
Raw Message
Post by Grant Taylor
Post by jrg
you're a linux user - you should know what that space does...
:-P
Typing in an MUA is different than typing on the command line. ;-)
You're a Linux user - you shouldn't be using an MUA for Usenet. :)

I suggest Pan. Or maybe slrn.
--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as the dirigible popped.
Usenet Improvement Project: http://twovoyagers.com/improve-usenet.org/
Thanks, Obama: Loading Image...
Grant Taylor
2018-07-06 02:44:25 UTC
Permalink
Raw Message
Post by Dan C
You're a Linux user - you shouldn't be using an MUA for Usenet. :)
I'm a unix user. I use what ever utility I want to use to do what ever
function I want to do.

I misspoke, Thunderbird is an MUA and a News Reader. You can cabitz
about the quality of news reader all you want. But it is still a news
reader that uses NNTP (more specifically NNRP) and is as true a news
reader as they come.
Post by Dan C
I suggest Pan. Or maybe slrn.
I'm willing to hear pros and cons to various news readers. I'm not
aware of any Linux GUI news readers (NUAs) that I like more than
Thunderbird.
--
Grant. . . .
unix || die
James Taylor
2018-07-11 23:22:34 UTC
Permalink
Raw Message
Post by Dan C
Post by Grant Taylor
Post by jrg
you're a linux user - you should know what that space does...
:-P
Typing in an MUA is different than typing on the command line. ;-)
You're a Linux user - you shouldn't be using an MUA for Usenet. :)
I suggest Pan. Or maybe slrn.
Or Emacs. ;)

Doug713705
2018-07-06 07:27:52 UTC
Permalink
Raw Message
Le 05-07-2018, Clark Smith nous expliquait dans
alt.os.linux.slackware
Post by Clark Smith
With this in mind, what I am asking from this forum is for
recommendations on what LVM howto(s) to peruse, especially with a view to
doing the deed in Slackware.
Everything is well documented in the README_LVM.TXT file at the root of
the Slackware install iso.

This document tells about installing Slackware on LVM but you can rely
on it for basic LVM setup even out of installation process.

If you plan to set LVM up out of the system installation process, don't
forget to format your LVM partitions before trying mounting it
(ie: mkreiserfs /dev/myvg/data) as you would have done in normal conditions.

If you plan to store one of "system filesystems" as /, /usr/ and so on
or if the data stored on the LVM filesystems need to be available at
boot time you will need to make an initrd embedding the needed modules
to read the filesystems within the LVM.

It's pretty easy.
--
Je ne connaîtrai rien de tes habitudes
Il se peut même que tu sois décédée
Mais j'demanderai ta main pour la couper
-- H.F. Thiéfaine, L'ascenceur de 22H43
Loading...