LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices

Reply
 
LinkBack Search this Thread
Old 03-24-2005, 06:49 AM   #1
SergeyAC
LQ Newbie
 
Registered: Mar 2005
Posts: 1

Rep: Reputation: 0
Question 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?
 
Old 03-29-2005, 02:17 PM   #2
sludink
Member
 
Registered: Jan 2005
Location: Brabant, the Netherlands
Distribution: Gentoo 2004.x (2.6.10 hardened)
Posts: 91

Rep: Reputation: 15
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.
 
Old 03-29-2005, 02:34 PM   #3
sludink
Member
 
Registered: Jan 2005
Location: Brabant, the Netherlands
Distribution: Gentoo 2004.x (2.6.10 hardened)
Posts: 91

Rep: Reputation: 15
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!
 
Old 04-11-2005, 01:28 PM   #4
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Rep: Reputation: 15
can u help me mounting a lvm on fedora 2?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Resize Root LVM Logical Volume??? jdupre Fedora 17 10-02-2010 07:21 AM
How do I resize LVM volume group? rconan Fedora 5 04-22-2009 07:45 PM
LVM Physical Volume Lucky_Sevin Linux - Software 2 01-10-2006 10:44 AM
Need to recover data from a LVM volume deyv Linux - General 13 07-25-2005 05:43 PM
Activating LVM Volume Groups at startup TomF Linux - Newbie 0 05-05-2004 05:05 PM


All times are GMT -5. The time now is 03:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration