Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
1. I've created a pair of files (X=0,1):
dd if=/dev/zero of=fileX
2. Set both files like block devices:
losetup /dev/loopX fileX
3. If I do mke2fs /dev/loopX; mount /dev/loopX /mnt/X - everything's OK; If i make software RAID of /dev/loopX, I can mount /dev/md0 without any problems
4. I've made new LVM volume using stripe of /dev/loopX. mke2fs /dev/mydg/test goes OK
fsck or mount says:
mount: wrong fs type, bad option, bad superblock on /dev/myvg/d0,
or too many mounted file systems
Where am I wrong?
Normally, people forget to set the type of the 'disk' (virtual disk in your scenario) to type 8E, Linux LVM. So use cfdisk /dev/loopX, go to type, and set it to 8E. (Could use fdisk to do this). If cfdisk ask you to start with an empty table, answer yes, by the way. You shouldn't make an fs on this devices for now!
This is how I think it should be done (tested it myself):
(This is for LVM2)
After the cfdisk setting type to 8E of the lo-devices, do
# pvcreate /dev/loop1
# pvcreate /dev/loop2
.... (for any other loops too)
vgcreate <<your_vg_name>> /dev/loop1 /dev/loop2 ....(any other loop devs)
Now, use vgdisplay <<your_vg_name>> to find out its total size.
Let's assume it's 16 Mb
Now, you're ready to use lvcreate.
lvcreate -i <<number-of-stripes>> -I <<stripesize_kB>> -L 16 <<your_vg_name>>
This should make a, by the LVM manager chosen device in /dev/<<your_vg_name>>/
After this, you should do mk<<some>>fs /dev/<<your-vg-name>>/<<LVM-chosen-dev-name>>
Maybe an example helps, so I shall post my .bash history:
As normal user:
$ dd if=/dev/zero of=/tmp/loop1 count=50000
$ dd if=/dev/zero of=/tmp/loop2 count=50000
Type passw, as SU:
#losetup /dev/loop1 /tmp/loop1
#losetup /dev/loop2 /tmp/loop2
(answer 'yes' when asked to start empty, create New Primary, set Type 8E, Write)
#cfdisk /dev/loop2lvcreate -i 3 -I 8 -L 48 VG2
(Same as loop1)
#vgcreate VG2 /dev/loop1 /dev/loop2
Look for Free PE / size, use size in Mb:
#lvcreate -i 2 -I 8 -L 48 VG2
-i 2 is the number of stripes, which shouldn't be more than the number of pv's you added to your vg.
LVM told me it created a volume called lvol0,
# mkreiserfs /dev/VG2/lvol0
# cd /mnt
# mount /dev/VG2/lvol0 /mnt/floppy/