Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have two drives (sde 120Gb) and sdh(250Gb) which I want to use for the following setup:
sde + 120Gb of sdh as a striped LVM as an ext4 partition
remaining 130Gb of sdh as a separate ext4 partition
I am able to use the build in partition manager in Mandriva to set up the rest of my disks and I can set up an LVM as planned above, but I find no way of choosing whether it should be linear or striped. This means I will most likely have to do it from the command line. Can someone help me out with the correct commands to set it up? Please?
With the help of ongte and some more googling I was able to set it up as desired. Here is how I did it (as help for other users).
Create Physical Volumes (Partitions, not physical drives, the name is a bit confusing.)
Create partitions of all parts that should be included. This can be done using fdisk but I used the partition configurator in Mandriva. If you use Mandriva select Logical Disk Volume Manager as type (toggle to expert mode). If you use fdisk make sure to mark them as 0x8e (Some pages say 0xFE but that seems to be the old standard)
For me this meant making sde as one entire partition and then an equal size partition on sdh. (The remaining space on sdh was set up as a regular ext4 partition).
Register the Physical Volumes with LVM
This is done automatically in Mandriva partitioner. Otherwise you can use the following command:
>pvcreate /dev/sde1
>pvcreate /dev/sdh1
Create a volume group (vg0)
This can be done in the Mandriva partitioner by selecting each partition and choosing "add to LVM". Add both to a new Volume Group named vg0.
>vgcreate vg0 /dev/sde1
>vgextend vg0 /dev/sdh1
3b. Verify the volume group by issuing the command:
>vgdisplay -v vg0
Create a striped logical volume (lg0) in volume group vg0
I was not able to figure out how to do this in Mandrivas partitioner so I used the following command:
>lvcreate -l100%FREE -nlv0 -i2 vg0 /dev/sde1 /dev/sdh1
-l100%FREE tells it to use the entire amount of space on the partitions. You could also read the physical Extents (PE) from the vgdisplay command and type in the total sum. Or use a lower percentage/amount. -nlv0 names the the Logical Volume -i2 tells it to stripe it across the two disks. vg0 is which volume group to use /dev/sde1 /dev/sdh1 adds the two physical volumes (partitions) to use
Judging from ongtes comment you could also use -I to specify the stripe size. Default is 64KB which is what I have. I am not sure of the benefit of making it higher/lower. If ongte or anyone else care to comment on the choice of stripe size I'd be very happy!
Verify your logical volume:
>lvdisplay -v /dev/vg0/lv0
Mount it:
>mount /dev/vg0/lv0 /media/mountposition
Glad you've got it working. As for stripe size, that largely depends on your environment & needs.
Obviously, if you have no idea, you can't go wrong choosing something in the middle. So 64KB makes sense as the default. There's really no reason to change that unless you have very specific performance requirements.
I thought I had it up and running. Tge lv0 was created, formatted, mounted. Added to fstab. Everything seemed fine.
...Reboot...
Now it won't work. lvdisplay for lv0 lists the lv0 but with "LV Status: NOT available".
Code:
[root@localhost]# lvdisplay
File descriptor 7 (/proc/1903/status) leaked on lvdisplay invocation. Parent PID 2873: bash
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
--- Logical volume ---
LV Name /dev/vg0/lv0
VG Name vg0
LV UUID wpYl01-4J9y-Y3s8-Nt8n-oNRf-NRVs-o6BBjL
LV Write Access read/write
LV Status NOT available
LV Size 228.98 GB
Current LE 58618
Segments 1
Allocation inherit
Read ahead sectors auto
Why won't it stick? Is there some change I must do to make the lv persitent after a reboot?
Additional information:
Code:
[root@localhost]# lvchange -ay lv0
File descriptor 7 (/proc/1903/status) leaked on lvchange invocation. Parent PID 2873: bash
Volume group "lv0" not found
Skipping volume group lv0
[root@localhost]# lvchange -ay /dev/vg0/lv0
File descriptor 7 (/proc/1903/status) leaked on lvchange invocation. Parent PID 2873: bash
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.