Fedora Core rescue and umount /mnt/sysimage
Today, I was trying to resize a logical volume of one of my systems running Fedora Core 5, configured with two LVM volumes (one for the root filesystem and another one for swap) on top of a software RAID-0. Since the volume I wanted to shrink holds the root filesystem, I had to boot from the Fedora Core 5 rescue CD in order to reduce the filesystem (ext2online didn’t allow me to reduce the filesystem on the fly), then reducing the volume itself.
Thus, I booted from the Fedora Core 5 DVD by entering linux rescue at the syslinux prompt, then choosed English for both the system language and keyboard layout. Since I was lazy, and didn’t want to manually set up the RAID disks and search for LVM volumes, I told Anaconda to scan the system for a Linux installation and mount it read-only under /mnt/sysimage.
What I didn’t know is that Anaconda also spawns up /mnt/sysimage/usr/bin/bash as the shell (instead of /bin/bash which is the one I expected), appends /mnt/sysimage/bin:/mnt/sysimage/sbin:\ to
/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:\
/mnt/usr/X11R6/binPATH and appends /mnt/sysimage/lib:/mnt/sysimage/usr/lib to LD_LIBRARY_PATH. So, when I tried to umount /mnt/sysimage it failed with a Device or resource busy error message:
# umount /mnt/sysimage/boot # umount /mnt/sysimage/dev # umount /mnt/sysimage/selinux # umount /mnt/sysimage/sys # umount /mnt/sysimage/proc # umount /mnt/sysimage umount: Device or resource busy
The solution was easy, however:
# exec /bin/bash # umount /mnt/sysimage # echo $? 0
I ran into something similar while trying to extend the root (/) partition. I couldn’t get the /mnt/sysimage to unmount. So I ended up booting “linux rescue” from the FC5 CD. Then do NOT mount the file system, instead at the shell prompt do:
# get the name of the vol group
lvm vgscan
# active the vol ie: /dev/Vol files are added)
lvm vgchange -a y /dev/VolGoup00
#Check the existing file system for errors:
e2fsck -f /dev/VolGroup00/LogVol00
#Resize the root (/) file system:
resize2fs /dev/VolGroup00/LogVol00
ref:
http://fedoranews.org/mediawiki/index.php/Expanding_Linux_Partitions_with_LVM
http://voidmain.is-a-geek.net/files/misc/expand_root_lv.html
http://www.redhat.com/archives/taroon-list/2005-October/msg00046.html
kazione said this on May 4th, 2006 at 04:49
Thanks for the additional comments, kazione!
Felipe Alfaro Solana said this on May 6th, 2006 at 17:13
It was just what I was looking for
Thanks a lot !!!
Biedak said this on July 6th, 2006 at 13:59
Thanks a lot! Trying to get FC6 installed as a vmware guest, spent half-an-hour recompiling the kernel only for the root fs to run out of space. BTW still needed to ‘umount’ the subdirectories after exec /bin/bash, YMMV. Ta.
Jamin Davis said this on December 31st, 2006 at 05:11
[...] As a side note, if you ever need to much with LVM, this page helped me a lot (the first comment to the article): http://felipe-alfaro.org/blog/2006/04/20/fedora-core-rescue-and-umount-mntsysimage/ [...]
routethis.net/blog » Blog Archive » Backups? What backups? said this on July 6th, 2007 at 18:04