LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Issues with LVM and renamed drives (http://www.linuxquestions.org/questions/linux-server-73/issues-with-lvm-and-renamed-drives-4175450947/)

Thakowbbery 02-20-2013 08:46 AM

Issues with LVM and renamed drives
 
Greetings,

Working on a virtual machine, Im adding a second disk to an existing system.
The first disk (sda) is formatted as following:

sda1 => boot
sda2 => swap
sda3 => /
sda4 => extended
sda5 => lvm

/usr, /tmp, /opt and so on are all LVs inside the LVM.

The thing is: when I add the new disk, it is added as sda and the older disk goes to sdb.

Solutions tried:
1) First I added labels to / and /boot and modified /etc/fstab: that solved the entire system booting issue;
2) Added labels to all LVs (usr, tmp, var and so on): When the system boots it is unable to locate the LVs
2.1) I believe the issue is caused because the LVMs PV is pointed as /dev/sda5: Is there any way I can somehow "label" /dev/sda5 and then change the LVM configuration somehow to point the PV to this label?
2.2) Tried pvchange --add-tag and that didnt work.

Thanks once again.

sharadchhetri 02-20-2013 10:37 AM

paste the output of following command -

mount
df -Th
cat /etc/fstab
lvscan
pvscan
vgscan

Thakowbbery 02-20-2013 11:56 AM

(Sorry for not actually copying/pasting the output. Due to some logical restrictions Im unable to ssh into this server from where I am).

This is the output without the additional disk. When I add the new disk everything that is /dev/sda turns into /dev/sdb

mount (proc, sys, swap and so on have been omitted):
/dev/sda3 on / type ext4 (rw)
/dev/sda1 on /boot type ext3 (rw)
/dev/mapper/vg00-lvhome on /home type ext4 (rw)
/dev/mapper/vg00-lvopt on /opt type ext4 (rw)
/dev/mapper/vg00-lvtmp on /tmp type ext4 (rw)
/dev/mapper/vg00-lvusr on /usr type ext4 (rw)
/dev/mapper/vg00-lvvar on /var type ext4 (rw)

df -Th (shows exactly the same as mount adding the total, used and avail spaces)

cat /etc/fstab:
LABEL=/ / ext4 defaults 1 1
LABEL=boot /boot ext3 defaults 1 2
LABEL=home /home ext4 defaults 1 2
LABEL=opt /opt ext4 defaults 1 2
LABEL=tmp /tmp ext4 defaults 1 2
LABEL=usr /usr ext4 defaults 1 2
LABEL=var /var ext4 defaults 1 2

lvscan: Shows the above LVs as ACTIVATED

pvscan:
PV /dev/sda5 VG vg00 lvm2 [<TotalSize> / <FreeSize>]

vgscan:
Found volume group "vg00" using metadata type lvm2

Ill re-add the disk and will place the output again

Thakowbbery 02-20-2013 03:40 PM

Okay everyone, problem solved.

Apparently it was a VMware issue.
I switched and re-switched the disks between virtual controllers and now the disks are being recognized correctly.


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