LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-14-2011, 05:49 PM   #1
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Rep: Reputation: 17
How to mount a LVM filesysem on USB drive?


I could not bootup a system as during the bootup procedure, it was throwing a ton of seg faults, so I removed the SATA hard drive from the system, put the drive in a USB hard drive dock, and attached that drive to another linux system.

I want to mount the filesystem to /mnt/external and poke around however I'm not sure how to mount the filesystem. The /boot drive on the USB drive (/dev/sdb1) was automounted on my desktop by CentOS, but the root filesystem (/dev/sdb2) was not. Here's what I tried:

Code:
[root@localhost ~]# mount /dev/sdb2 /mnt/external/
mount: you must specify the filesystem type
I already have an existing LVM system on the system the disk is attached to so I don't want the USB drive to conflict with that. Both systems were installed using the same method and the internal disk (/dev/sda) in the working system is the same size as the USB disk (/dev/sdb), 500GB. I think there might be a naming conflict as the same default names for the volgroups/logical volumes were the same, so I think I have to rename something on the USB drive? Thanks for any assistance!

Code:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 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       60801   488279610   8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14       60801   488279610   8e  Linux LVM
[root@localhost ~]# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup00
  PV Size               465.66 GB / not usable 3.56 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              14901
  Free PE               0
  Allocated PE          14901
  PV UUID               6gcNsc-PP8w-kG5H-NLKP-0KD8-e6y5-35tCTf
   
[root@localhost ~]# vgdisplay 
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.66 GB
  PE Size               32.00 MB
  Total PE              14901
  Alloc PE / Size       14901 / 465.66 GB
  Free  PE / Size       0 / 0   
  VG UUID               NbUOhh-xEyM-gcsx-2wAb-v5As-bM0j-7yHLBY
   
[root@localhost ~]# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                GyT60S-y6em-V50j-i3bL-5aEi-HXV2-HmXqCD
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                463.72 GB
  Current LE             14839
  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                y59G8x-r4nU-e3yB-Y366-Bu2B-PK2p-FTGORd
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.94 GB
  Current LE             62
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1 

[root@localhost ~]# cat /etc/mtab
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sda1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/dev/sdb1 /media/_boot ext3 rw,noexec,nosuid,nodev 0 0

[root@localhost ~]# pvscan 
  PV /dev/sdb2   VG VolGroup00   lvm2 [465.66 GB / 0    free]
  PV /dev/sda2   VG VolGroup00   lvm2 [465.66 GB / 0    free]
  Total: 2 [931.31 GB] / in use: 2 [931.31 GB] / in no VG: 0 [0   ]

[root@localhost ~]# lvscan 
  ACTIVE            '/dev/VolGroup00/LogVol00' [463.72 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [1.94 GB] inherit

Last edited by Arodef; 01-14-2011 at 06:26 PM.
 
Old 01-14-2011, 07:28 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
Normally one would just run from a recovery CD and rename the vg(s) on the USB. I noticed this if you're up for a small hack.
Will be easier if you have run vgcfgbackup sometime in the past.
 
Old 01-14-2011, 07:37 PM   #3
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Original Poster
Rep: Reputation: 17
Okay I couldn't figure out how to rename the volume group when two shared the same name in a system, so I moved the hard drive from the USB back into its original system, then I booted with a rescue disk. Make sure to choose SKIP when it says it will find Linux installations, you want the logical volumes to be inactive so the volume group can be renamed so don't let it mount it. Then I these steps which I found in a previous post (http://www.linuxquestions.org/questi...o-do-375928/):

lvm vgscan
lvm lvscan
lvm vgchange -a y
lvm pvscan
lvm lvscan
lvm vgchange -a n
lvm vgrename VolGroup00 VolGroup11

Then I put the disk back in my other system as a USB drive, I did these steps to mount it:


[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup11" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
[root@localhost ~]# lvscan
inactive '/dev/VolGroup11/LogVol00' [463.72 GB] inherit
inactive '/dev/VolGroup11/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [463.72 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
[root@localhost ~]# vgchange -a y
2 logical volume(s) in volume group "VolGroup11" now active
2 logical volume(s) in volume group "VolGroup00" now active
[root@localhost ~]# pvscan
PV /dev/sdb2 VG VolGroup11 lvm2 [465.66 GB / 0 free]
PV /dev/sda2 VG VolGroup00 lvm2 [465.66 GB / 0 free]
Total: 2 [931.31 GB] / in use: 2 [931.31 GB] / in no VG: 0 [0 ]
[root@localhost ~]# mount -t ext3 /dev/mapper/VolGroup11-LogVol00 /mnt/externaldisk/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount drive that has Linux LVM ufmale Linux - Newbie 1 06-03-2010 09:33 PM
mount an external usb lvm scc28y Linux - General 4 01-12-2009 10:35 PM
Mount old lvm scsi drive on new installation k1mgy Fedora 2 07-24-2006 02:42 AM
mount usb module then mount usb hard drive guanyu Linux - Hardware 1 10-08-2003 12:50 PM
how to mount NTFS filesysem sakeeb Linux - General 6 06-18-2002 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration