LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   LVM volume mounting trouble (http://www.linuxquestions.org/questions/linux-software-2/lvm-volume-mounting-trouble-305442/)

SergeyAC 03-24-2005 06:49 AM

LVM volume mounting trouble
 
I have such a situation (RH Enterprise 3)

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?

sludink 03-29-2005 02:17 PM

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)

Then, do:
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.
Something like
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>>

Then you should be able to mount it.

sludink 03-29-2005 02:34 PM

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
$ su
Type passw, as SU:

#losetup /dev/loop1 /tmp/loop1
#losetup /dev/loop2 /tmp/loop2
#cfdisk /dev/loop1
(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)

#pvcreate /dev/loop1
#pvcreate /dev/loop2
#vgcreate VG2 /dev/loop1 /dev/loop2
#vgdisplay VG2
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
# ls
# mount /dev/VG2/lvol0 /mnt/floppy/

Worked for me!

ciberrust 04-11-2005 01:28 PM

can u help me mounting a lvm on fedora 2?


All times are GMT -5. The time now is 11:02 PM.