Fedora Core rescue and umount /mnt/sysimage
April 20th, 2006
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
May 4th, 2006 at 4:49 AM
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
May 6th, 2006 at 5:13 PM
Thanks for the additional comments, kazione!
July 6th, 2006 at 1:59 PM
It was just what I was looking for
Thanks a lot !!!
December 31st, 2006 at 5:11 AM
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.
July 6th, 2007 at 6:04 PM
[...] 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/ [...]
October 30th, 2008 at 7:03 PM
Thanks a lot. You are a life saver
December 12th, 2008 at 5:28 PM
Great, thanks! I used the method provided by kazione on RHEL 4, works perfectly. At first I tried umounting /mnt/sysimage, but I guess there where too many connections to that device already and I didn’t want to take half a day killing all those processes…
February 2nd, 2010 at 2:45 PM
great hints and easy to search. thx a lot.
October 7th, 2010 at 12:47 AM
Thanks a lot Felipe and Kazione, I was looking for something like this, this solved my problem.
December 14th, 2011 at 2:33 PM
I’ve been exploring for a little bit for any high-quality articles or blog posts on this kind of space . Exploring in Yahoo I ultimately stumbled upon this website. Reading this information So i am happy to show that I have an incredibly just right uncanny feeling I came upon just what I needed. I such a lot indubitably will make certain to don’t forget this web site and give it a glance regularly.
January 20th, 2012 at 4:41 PM
Interesting what you are saying about the cat5 cables I tried this to connect 2 pcs together one running XP Pro and one running Win7 with GB network cards and both show a gb connection with crossover cable but I’ve not used anything to check the actual transfer speed, how can you connect 2 pcs directly with a staight through cable?