Need To Unmount An LV From Host System

Home » CentOS-Virt » Need To Unmount An LV From Host System
CentOS-Virt 3 Comments

Greetings –

Ok, I made a mistake that I need to fix. Fortunately it is not a destructive mistake, but I need some advice on how to correct the problem. CentOS 6.3 host system named Earth

I was creating some new logical volumes within my exiting volume group for a new virtual machine using the LVM GUI. When I created the LV that I plan to use for root partition of the new VM (Bacteria) I mistakenly clicked on the box to mount the LV, and specified the mount point as /.

[root@earth ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_mei-lv_earthroot 5.0G 3.9G 880M 82% /
tmpfs 5.9G 276K 5.9G 1% /dev/shm 
/dev/sda1 485M 116M 344M 26% /boot
/dev/mapper/vg_mei-lv_earthvar 3.0G 748M 2.1G 27% /var
/dev/mapper/vg_mei-lv_bacteriaroot 5.0G 3.9G 880M 82% /

I tried to unmount the device, but as shown below, it is busy.

[root@earth ~]# umount /dev/mapper/vg_mei-lv_bacteriaroot umount: /: device is busy.
(In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
I tried to force unmount the device, but that failed also.

 

[root@earth ~]# umount -f /dev/mapper/vg_mei-lv_bacteriaroot umount2: Device or resource busy umount: /: device is busy.
(In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
umount2: Device or resource busy

What other options are there. Is there are way to get this unmounted without having to shutdown my host system and boot into rescue mode. I don’t really want to shutdown my active VM’s while other staff are working on them right now.

3 thoughts on - Need To Unmount An LV From Host System

  • So you mounted that new LV as / (or over the existing root) on your host node?

    You may end up needing to boot to a rescue CD, mount, and rsync files from Bacteria’s root to Earth’s [real] root. ( I wonder if anything is being written to Bacteria’s root since it’s mounted over the real root. )

    I would have expected you could unmount it given that you’re umounting by the device name. Having it mounted on or over root likely makes this a bit finicky.

    Take the advice of the output you pasted … check the output from lsof and see if you can’t narrow down the problem.

    After you accidentally mounted that LV on root did you change your directory? Something is hanging on to that device.

  • Il 05/03/2013 21:24, jboyce@meridianenv.com ha scritto:
    I don’t know if this is usefull to you but you can try one of these:
    mount –bind olddir newdir or mount -o remount olddir newdir or mount –move olddir newdir

    Hope this can help you.

    Sincerely, Gabriele Matteelli

LEAVE A COMMENT