LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Not able to unmount /home in Ubuntu13.04 (https://www.linuxquestions.org/questions/linux-hardware-18/not-able-to-unmount-home-in-ubuntu13-04-a-4175475194/)

ravisingh1 08-29-2013 11:09 AM

Not able to unmount /home in Ubuntu13.04
 
I don't get why I can't unmount /home from root directory.
I tried via terminal (command line) as well as gparted.
It messages "device is busy"
I closed all applications. Still can't succeed.
Why so?
I am using Ubuntu13.04

TobiSGD 08-29-2013 01:10 PM

Do you have any user logged in? This will prevent unmounting. To find out what is still using home try it with
Code:

lsof /home

jefro 08-29-2013 02:33 PM

I get the feeling that you can't usually unmount home unless you log off and log on to root. I could be way wrong on that. Almost any user setting or app might lock it.

TobiSGD 08-29-2013 05:41 PM

Quote:

Originally Posted by jefro (Post 5018427)
I get the feeling that you can't usually unmount home unless you log off and log on to root. I could be way wrong on that. Almost any user setting or app might lock it.

Usually the WM or DE itself will prevent from unmounting, since they have configuration files, caches and other functionality, like virtual filesystems in the users directory. So if you want to unmount /home you have to logout or better switch to runlevel 1 (or the single target if your distro uses systemd).

jefro 08-29-2013 07:14 PM

One of those questions that I have never had a reason to test.

haertig 08-30-2013 12:10 AM

You will find it much easier to do any maintenance requiring an unmounted /home by booting from a LiveCD. As soon as you do a normal user login from a normal boot on a typical system, you are most assuredly using /home yourself. Extricating yourself from using /home will be tricky. You could probably manage it as userid 'root' from runlevel 1 also. Booting from a LiveCD is probably simpler though.

ravisingh1 08-30-2013 02:08 AM

Quote:

Originally Posted by TobiSGD (Post 5018384)
Do you have any user logged in? This will prevent unmounting.

Yes it's me who is logged.
Thanks, I got the reason why I wasn't able to unmount /home.
Quote:

Originally Posted by jefro (Post 5018427)
I get the feeling that you can't usually unmount home unless you log off and log on to root. I could be way wrong on that.

Yes jefro, this was possible to log in as root when earlier I was working on old distro Fedora 9.
But is it possible in Ubuntu13.04?

As such I have got my solution from other posts herin, i.e. via runlevel1 or live CD.

ravisingh1 08-30-2013 02:45 AM

Quote:

Originally Posted by haertig (Post 5018687)
As soon as you do a normal user login from a normal boot on a typical system, you are most assuredly using /home yourself. Extricating yourself from using /home will be tricky.

It is possible if I change my home directory from /home/ravbholua to say "/". I haven't tried this but simply saying a way to achieve that. But yes it w'd possible if system allows me as well as root to have the same home directory.
I only told a way but what I told may not be at all possible. I w'd try later.

TobiSGD 08-30-2013 05:52 AM

Quote:

Originally Posted by ravisingh1 (Post 5018726)
Yes jefro, this was possible to log in as root when earlier I was working on old distro Fedora 9.
But is it possible in Ubuntu13.04?

Ubuntu by default does not support logging in as root. You can circumvent that by rebooting the machine and booting into recovery mode, you will be automatically logged in as root and the machine will be in runlevel 1 for maintenance work.

Firerat 08-30-2013 06:11 AM

you can set a traditional root account

Code:

sudo -i
passwd

was always my first job on *buntu

ravisingh1 08-30-2013 10:16 AM

Quote:

Originally Posted by Firerat (Post 5018822)
you can set a traditional root account

Code:

sudo -i
passwd

was always my first job on *buntu

It may be that I misunderstood the above.
I ran the above 2 commands. for passwd, I entered password.
I rebooted expecting that in login screen username w'd be there for root using which I w'd enter the system. But no, nothing like this.
What I misunderstood?

Firerat 08-30-2013 12:19 PM

root is still hidden from the graphical login

you shouldn't use root for a 'desktop environment'
instead. get a console with. ctrl+alt+F1 ( through to F6 )

get back with alt+f7 ( might be 8 or 9 )
'

jefro 08-30-2013 05:05 PM

Not sure going to a console from a gui would work. I'd think some part of home might still be locked.

Most distro's are trying to keep common folks safe. They do that by default settings. One has been a hot button topic as to log on to root either by init 3 or gui. Most admins don't think that is a good idea. So, some users do know of ways to enable root again.

We have all basically agreed that /home is locked by some means and you have to get around those means. Either live boot, single user, init 3 or such. Normally home is a needed mount point for a common user to log on.

Firerat 08-30-2013 05:22 PM

yeah, but with root can switch runlevel

or just stop the gui login
Ubuntu so,, as root

Code:

service gdm3 stop

jpollard 08-30-2013 05:52 PM

Quote:

Originally Posted by TobiSGD (Post 5018545)
Usually the WM or DE itself will prevent from unmounting, since they have configuration files, caches and other functionality, like virtual filesystems in the users directory. So if you want to unmount /home you have to logout or better switch to runlevel 1 (or the single target if your distro uses systemd).

This works SOMETIMES. If you are using a system with a .gvfs mount though, it won't because the filesystem will always be busy as long as gnome is active. It is also possible that EVEN THEN it won't dismount - because some GUI application has a file open (sometimes just for logging errors) and THAT will prevent you from dismounting.

If you want to find out what is preventing it, do a "fuser -mu /home". This will list any processes that have files open on the /home filesystem (and list how it is used - see the fuser manpage for all that) and the user name associated.


All times are GMT -5. The time now is 07:33 PM.