PDA

View Full Version : LV question...



tristanlee85
21st February 2010, 06:24 AM
What I am trying to do is mount the logical volume on my 2nd SATA drive. I am able to mount that and access the files just fine. I am confused about something though.


[root@localhost tristan]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup lvm2 a- 232.69G 0
/dev/sdb2 VolGroup00 lvm2 a- 465.56G 32.00M


sda is the drive I am booted from right now, and sdb is the drive that has my old Fedora installation that I want to access. From what I see here, VolGroup refers to the primary drive and VolGroup00 is my secondary drive.

Here is the LV information:

sda

[root@localhost tristan]# lvdisplay /dev/VolGroup
--- Logical volume ---
LV Name /dev/VolGroup/lv_root
VG Name VolGroup
LV UUID 4ut4UD-zLvk-DPOo-DwQs-tjWs-lrgu-E7WjGI
LV Write Access read/write
LV Status available
# open 1
LV Size 227.72 GB
Current LE 58296
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---
LV Name /dev/VolGroup/lv_swap
VG Name VolGroup
LV UUID 5bmbML-9Smf-r02h-ej0Y-K6vb-I1lR-RWjKKG
LV Write Access read/write
LV Status available
# open 1
LV Size 4.97 GB
Current LE 1272
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3


sdb

[root@localhost tristan]# lvdisplay /dev/VolGroup00
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID izmpK9-bl9j-Azs4-HXe9-wiQV-waIG-uqNyDk
LV Write Access read/write
LV Status available
# open 1
LV Size 463.59 GB
Current LE 14835
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 wgiyJg-4oRO-SRgQ-i2yn-w0n3-XKbT-18m7Aj
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


Here's the contents of fstab. I notice that the LV of sdb is there and I did not put it there. I am assuming the system automatically discovered it and used it as a second swap space? Right below it is my mapping for mounting my old files.


/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=9e84e720-8e8d-4e02-84f7-b308d1b1f8a7 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
/dev/mapper/VolGroup00-LogVol01 swap swap defaults 0 0
/dev/VolGroup00/LogVol00 /mnt/backup ext2 defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0


Everything is working... no problems here. I'm just curious about the 2 swap filesystems.

SlowJet
21st February 2010, 06:52 AM
I would say that sdb used to be some other fedora default install and you later used ot for a backup by re-formating /dev/VolGroup00/LogVol00 as ext2 and mounting it on .mnt/backupup
or you just mounted the old file system as ext2 and if iis probably difficult to use as the file directories, permissions and selinux labels would be all meaningless, and if it were ext3 originally in danger of being trash during a power outage (if ext4 originally, the read results would be unpredictable.

The second swap is just left over from the original fedora default install on the disk on sdb.

SJ

tristanlee85
21st February 2010, 06:56 AM
sdb has a Fedora 9 install on it. If I were to swap the SATA cables, sdb would boot as sda. I have not modified the filesystem on either drive. I'm just mounting the LV of my old drive so I can copy over data before wiping it.

SlowJet
21st February 2010, 07:54 AM
Well, every fedora idefault install has a swap on an LV and Linux uses all the swap it finds.

SJ.

tristanlee85
21st February 2010, 07:55 AM
Cool. That's what I was wondering. Thanks.