Showing posts with label LVM2. Show all posts
Showing posts with label LVM2. Show all posts

Wednesday, 14 May 2008

XEN + LVM2




Recently, my company was set up a sys with xen and bound on LVM2.
However, I got the problem while I resizing the domU by resize2fs.
I could not see the extending size in domU by "df -h", and I even have resized the device of block on dom0.
I figure it out after trying plenty of times to reboot and fix the filesystem.
Okeydoke, The method to resolve resize is as below.

step1:
lvextend logical volume
step2:
resize -f /dev/volume_group/device_point
step3:
reboot domU
step4:
@domU doing " resize /dev/sda1"

Tuesday, 11 September 2007

Trouble in LVM with devfsd

在祥大離開的第一天,就有Old Server馬上發難。由於本部門不良習慣,都不會去遵照lvm的使用原則,所以dmtab都會留空白。之所以trouble後reboot也能開機,是因為有devfsd的照顧; devfsd是靜態的device link,又加上/etc/lvm/backup/ 所以都可以自己回復到對應位子,也就養成不良的LVM使用習慣。

但今天卻發生了特例,devfsd不理lvm了,所以在起來後全部的device-mapper是空的,不用說全部對應的service也就掛點;所以就只好先查查看到底有哪些東西不存在。

# lvdisplay
(空)


# vgdisplay
(空)

# pvdisplay

(空)

那代表整個partition都被lvm遺忘了,只好先建立回去。

#pvcreate /dev/sda4

馬上就得到反應,因為/etc/lvm/backup下有建立的valume group的資訊,所以馬上就可以被帶入,很幸運的連lv都可以看到。此時以為已經可以掛起使用,但事與願違,在/dev/device-mapper/下依舊是空的,所以試著利用已知資訊UUID來反建立回去。

# dmsetup
create /dev/vgname/mysql -u oaVWN4-xnUV-qL9T-qLYa-hIWY-Zlnp-eLH160
(空)

依舊是空的,所以只能土法煉鋼,用手動的方式建立。

# cat /proc/devices

Block devices:
(略)
253 device-mapper

知道了device-mapper的位子,就可以手動建立。

# cd /dev/device-mapper
# mknod -m 660 vgname-mysql b 253 0
# mknod -m 660 vgname-fucker b 253 1

這樣就有了block device了,但這樣還是不夠可以使用,需要讓lvm去認它,所以要下:

# vgchange -a y

讓整個volume group重新 active一次,然後就可以看到原本消失的在lvdisplay底下的block device又回復了,看到那個就代表已經復原成功了。

當然還是別忘了寫回dmtab。

# dmsetup table >> /etc/dmtab

後記: 不過在udev下若沒有任何記錄在dmtab下的話,那只有打掉重練了,就不可能用這篇的方法建回。

Friday, 8 June 2007

LVEXTEND WITH XFS FILESYSTEM

It's not special skill to extend size online in xfs filesystem, and command as below.



xfs_growfs /dev/valgp/mysql



However, I got the bomb this time. A part of my lvm space is full, so I extended 20G and grow it online.

That should be untrouble for me to resolve this problem, but I were wrong to think so easy.

It replied my an error msg "No more space left". Thus, I have to deduct some file from the device before extending the space.



mysql -e "purge master to 'mysqld-00001.log;'
xfs_growfs /dev/valgp/mysql



That's it! dummy.

Wednesday, 9 May 2007

LVM2 + XFS =! LVM2 + other FileSys on snapshot mountpoint.









LVM2:

It's working fine with all Filesystem, but I got shoot while I snapshotted with xfs.
And then, I'd tried all filesystem within shapshot to make clearly, which might cause accident.
As the result, everything was fine with dm-snap, expecting XFS, and then I got the message as following.

XFS:Filesystem dm-6 has duplicate UUID - can't mount.


I seemed like xfs might do some processing for checking device-map, so it didn't allow the same UUID be appeared.
Finally, I just need to point out the parameter to skip while mounting, and then command as below.

mount -t xfs -o noatime,nosuid,nouuid /devmyvg/fuckersnap /mnt/floppy/



Edited on 9th of May.