LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting LVM filesystem (http://www.linuxquestions.org/questions/linux-newbie-8/mounting-lvm-filesystem-683531/)

gelex 11-15-2008 04:12 AM

Mounting LVM filesystem
 
Hi everybody, this is the problem: I've installed Fedora 9 on my pendrive and I'm trying to copy the files of my forward installation of Fedora, which is in the hd. At the shell, I can't mount the filesystem of the previous installation.
This is the output

[root@localhost ~]# fdisk -l /dev/sdb4
Disco /dev/sdb4: 41.9 GB, 41948928000 byte
255 heads, 63 sectors/track, 5100 cylinders
Units = cilindri of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfffcd375
Il disco /dev/sdb4 non contiene una tabella delle partizioni valida
(Disk /dev/sdb4 doesn't contain a valid partition table)

[root@localhost michele]# mount /dev/sdb4 /mnt/linux
mount: si deve specificare il tipo di filesystem
(you have to specify the filesystem)
[root@localhost michele]# mount -t ext3 /dev/sdb4 /mnt/linux
mount: il device speciale /dev/sdb4 non esiste
(special device /dev/sdb4 doesn't exist)

Any idea?

unSpawn 11-15-2008 04:30 AM

With LVM you can use 'pvscan' and 'vgscan' (or 'disktype' if available) to get specs, then 'vgchange -ay' to enable the LVM. After that running 'dmsetup status' or lvdisplay' should show which LVM is available, after which you can mount the device as you would any partition.

gelex 11-15-2008 04:43 AM

Just another output, to better understand my situation

[root@localhost ~]# fdisk -l

Disco /dev/sda: 4126 MB, 4126670848 byte
255 heads, 63 sectors/track, 501 cylinders
Units = cilindri of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000132f4

Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 501 3823470 8e Linux LVM

Disco /dev/dm-0: 3556 MB, 3556769792 byte
255 heads, 63 sectors/track, 432 cylinders
Units = cilindri of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Il disco /dev/dm-0 non contiene una tabella delle partizioni valida

Disco /dev/dm-1: 301 MB, 301989888 byte
255 heads, 63 sectors/track, 36 cylinders
Units = cilindri of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Il disco /dev/dm-1 non contiene una tabella delle partizioni valida

Disco /dev/sdb: 160.0 GB, 160041885696 byte

255 heads, 63 sectors/track, 19457 cylinders
Units = cilindri of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd24d17c7

Dispositivo Boot Start End Blocks Id System
/dev/sdb1 1 1530 12288000 27 Sconosciuto
/dev/sdb2 * 1530 13319 94689280 7 HPFS/NTFS
/dev/sdb3 14343 14357 120487+ 83 Linux
/dev/sdb4 14358 19457 40965750 8e Linux LVM

Who can help me step by step?

unSpawn 11-15-2008 05:42 AM

Which commands in my previous post didn't give you output to post and stuff to mount?

gelex 11-15-2008 07:52 AM

Thanks unSpawn 4 your help.
The output is this
[root@localhost ~]# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [3,62 GB / 32,00 MB free]
Total: 1 [3,62 GB] / in use: 1 [3,62 GB] / in no VG: 0 [0 ]
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
[root@localhost ~]# vgchange -ay /dev/sdb4
Volume group "sdb4" not found
[root@localhost ~]# vgchange -ay /dev/sdb4/VolGroup00
Invalid volume group name: sdb4/VolGroup00
[root@localhost ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID P2MPFy-0402-InGZ-tuvA-whrf-LM4N-ZEjlf3
LV Write Access read/write
LV Status available
# open 1
LV Size 3,31 GB
Current LE 106
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID OsOpfV-lDqp-jRiG-1U1N-vJQU-0cp2-bnFy86
LV Write Access read/write
LV Status available
# open 1
LV Size 288,00 MB
Current LE 9
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

As it seems, VolGroup00 in sdb4 is not seen as a LinuxLVM volume

unSpawn 11-15-2008 08:46 AM

Quote:

Originally Posted by gelex (Post 3342640)
As it seems, VolGroup00 in sdb4 is not seen as a LinuxLVM volume

As far as I know "VolGroup00" is the default name of the first installed LVM, so that'll be the case each time you install an OS with LVM. I just can't see how to "trick" vgchange's scope to only look at one physical device without disconnecting /dev/sda or using virtualisation...

ritam_bkp 11-15-2008 12:55 PM

this would be helpful

http://tldp.org/HOWTO/LVM-HOWTO/

gelex 11-15-2008 03:19 PM

Thanks, but it's usless to me.

gelex 11-16-2008 10:05 AM

Help, the disk is drowning!

unSpawn 11-16-2008 12:59 PM

Quote:

Originally Posted by gelex (Post 3343021)
Thanks, but it's usless to me.

Actually it isn't, but you'd have to read it. Having 2 LVM's with the same VG specs won't show the second one if scanning finds the first one. If you could boot a Live CD maybe you could use it in rescue mode to 'vgrename' the VG name, 'pvchange' the devices UUID's and 'lvrename' the LV name. I can not be held responsable for you crashing, breaking, erasing, nuking or erroneously or wilfully malfunctioning otherwise your setup so do make backups or find a way to transfer to an intermediate FS both understand or boot the other distro using virtualisation.

neocontrol 12-24-2008 09:28 AM

Hi,

I think I have a very similar problem like this, and was wondering if someone can clarify this for me....


So I had a 250gb drive which had a lot of things installed on it. I didn't want to lose it, but I also wanted to install a new OS. So I pulled the disk, replaced it with a 120gb drive installed a new OS.

Now I'm trying to mount the old 250gb drive.

The current drive is a LVM as well is the old drive.

So from this post, my understanding is that if you an VolGroup00 on both drives, you will not be able to mount it.

Here's the info.

------------------

fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 14593 117113850 8e Linux LVM

Disk /dev/sda: 249.9 GB, 249998918144 bytes
255 heads, 63 sectors/track, 30393 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 30393 244027350 8e Linux LVM


---------------------

pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [232.72 GB / 0 free]
PV /dev/hda2 VG VolGroup00 lvm2 [111.69 GB / 0 free]
Total: 2 [344.41 GB] / in use: 2 [344.41 GB] / in no VG: 0 [0 ]


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