PDA

View Full Version : The road to dracut was paved with LVM


SlowJet
11th September 2009, 12:50 AM
Rawhide can be hard when there is no rawhide (and no space on /)

After about an hour of getting updates to resolve the kernel-2,6,31-2 the rpm --test was succesful.
It needed a certain version of dracut-kerenl, and dracut-kernel (of course) needed dracut.)

Removing the --test on the rpm -ivh
it came back and said it needed 3MB in the / f/s. I had 53MB.

I rebooted into the old kernel and it came up showing / now had 66MB.
I was able to install the new kernel, now I only had 8MB in /. It took over 57MB.

SO LVM to the rescue. BTW: I'm running this in VBox-3.0.6 or it would have crash long ago.
I shut down and add another vdi to the secondary controller.

Booted up into the new dracut initramfs and 31-2 kernel.
I used fdisk to make a sdb1 8e partition, pvcreate, vgcreate (a seperate VG.
lvcreate a new lv for home.
mkfs.ext4 /dev/mapper-newvg-lvnewhome.
mkdir /mnt/newhome
mounted the newhome LV

Then I practiced using the
cp -R --preserve=all -t /mnt/newhomw (while in root at /home
It took a bit to get * .* and be satisfied with the warning messages..

I umount the /mnt/newhome

logout and switch to Ctrl-Alt-F3

umount /home

mount /dev/mapper/newvg-newhome /home
looked good
cd /etc
nano fstab (change the /home mount.

Ctrl-Alt-F1 back to GDm logon
Surpizingly, I did NOT get the enter context error.
Logon and gnome came up.

Open a terminal
unknow to me was a warning popup about / has zero space, now (I think it had 6MB actually)

root
lvm lvremove oldhomelv
lvm lvextend --extents +12 /LV
resize2fs /dev/mapper/VG-slashlv

# lvm lvextend --extents +12 /dev/mapper/vg_cathy12-LogVol12slash
Extending logical volume LogVol12slash to 800.00 MB
Logical volume LogVol12slash successfully resized
[root@Cathy-12 ~]# man resize2fs
Formatting page, please wait...
[root@Cathy-12 ~]# resize2fs /dev/mapper/vg_cathy12-LogVol12slash
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/mapper/vg_cathy12-LogVol12slash is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/mapper/vg_cathy12-LogVol12slash to 819200 (1k) blocks.
The filesystem on /dev/mapper/vg_cathy12-LogVol12slash is now 819200 blocks long.

Success

SJ

[root@Cathy-12 ~]# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_cathy12-LogVol12slash
793349 383414 369004 51% /
/dev/mapper/vg_cathy12-LogVol12tmp
253871 10303 230461 5% /tmp
/dev/mapper/vg_cathy12-LogVol12var
774064 484248 250496 66% /var
/dev/mapper/vg_cathy12-LogVol12usr
4837920 2929432 1662728 64% /usr
/dev/sda1 198337 78519 109578 42% /boot
tmpfs 506052 248 505804 1% /dev/shm
/dev/mapper/vg_cathy21-LogVol21newhome
8256952 488840 7600340 7% /home

SlowJet
11th September 2009, 01:21 AM
Finishing touches

# lvm lvextend --extents +8 /dev/mapper/vg_cathy12-LogVol12var
Extending logical volume LogVol12var to 1.00 GB
Logical volume LogVol12var successfully resized
[root@Cathy-12 ~]# resize2fs /dev/mapper/vg_cathy12-LogVol12var
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/mapper/vg_cathy12-LogVol12var is mounted on /var; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/vg_cathy12-LogVol12var to 262144 (4k) blocks.
The filesystem on /dev/mapper/vg_cathy12-LogVol12var is now 262144 blocks long.

[root@Cathy-12 ~]# lvm lvextend --extents +12 /dev/mapper/vg_cathy12-LogVol12usr
Extending logical volume LogVol12usr to 5.06 GB
Logical volume LogVol12usr successfully resized
[root@Cathy-12 ~]# resize2fs /dev/mapper/vg_cathy12-LogVol12usr
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/mapper/vg_cathy12-LogVol12usr is mounted on /usr; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/vg_cathy12-LogVol12usr to 1327104 (4k) blocks.
The filesystem on /dev/mapper/vg_cathy12-LogVol12usr is now 1327104 blocks long.

[root@Cathy-12 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol12slash vg_cathy12 -wi-ao 800.00M
LogVol12swap vg_cathy12 -wi-ao 1.00G
LogVol12tmp vg_cathy12 -wi-ao 256.00M
LogVol12usr vg_cathy12 -wi-ao 5.06G
LogVol12var vg_cathy12 -wi-ao 1.00G
LogVol21newhome vg_cathy21 -wi-ao 8.00G
[root@Cathy-12 ~]# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_cathy12-LogVol12slash
793349 383420 368998 51% /
/dev/mapper/vg_cathy12-LogVol12tmp
253871 10303 230461 5% /tmp
/dev/mapper/vg_cathy12-LogVol12var
1032088 484432 495232 50% /var
/dev/mapper/vg_cathy12-LogVol12usr
5225040 2929432 2033468 60% /usr
/dev/sda1 198337 78519 109578 42% /boot
tmpfs 506052 272 505780 1% /dev/shm
/dev/mapper/vg_cathy21-LogVol21newhome
8256952 490260 7598920 7% /home