LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-03-2008, 03:37 AM   #1
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Rep: Reputation: 15
mounting and unmounting


So i unmounted my sdb1 but when i try to mount sdb1 to /home i get error:
umount /mnt/sdb1
mount /dev/sdb1 /home
mount: /dev/sdb1 already mounted or /home busy

How to fix this??
 
Old 06-03-2008, 03:44 AM   #2
jeetu
LQ Newbie
 
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
reply

hey, y dnt u try to mount it into any other directory like mnt.......
u can't mount any file or directory into ur home directory...........
coz it contains all the details of user.............
 
Old 06-03-2008, 03:45 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Most likely /home is busy, unless /dev/sdb1 is meant to be the /home partition. In this case you have to select another mount point, like /home2, /mnt, /home/tmp or whatever.
 
Old 06-03-2008, 03:46 AM   #4
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
yeah but the thing is, i really need it to be /home is there a way to bypass this?
 
Old 06-03-2008, 03:49 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You have to unmount the /home partition (first be sure that no user is logged in and disable remote connections from regular users, if any) then you can mount /dev/sdb1 on /home.
 
Old 06-03-2008, 03:53 AM   #6
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
ok thx,

i just tried this, unmount /mnt/sdb1
And try to mount it back: mount /dev/sdb1 /mnt/sdb1
mount: /dev/sdb1 already mounted or /mnt/sdb1 busy

And i can no do: dir /dev/sdb1 its just empty??

Last edited by zerocool22; 06-03-2008 at 03:55 AM.
 
Old 06-03-2008, 03:57 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by zerocool22 View Post
i just tried this, unmount /mnt/sdb1
The command is umount (without n). Maybe this is only a typo. Anyway you can verify if the filesystem /dev/sdb1 has been unmounted, or the /mnt/sdb1 is busy using the mount command without arguments. This will simply give you a list of the filesystems currently mounted (with mount point, filesystem type and mount options).
 
Old 06-03-2008, 03:58 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First of all, why are you using the /home partition to do this? You will cover up the users home directories.

You will need to log out all regular users and then log in to the console as root. Then you will be able to umount /home since root's home directory is /root instead of /home/username/.
 
Old 06-03-2008, 04:05 AM   #9
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
the sdb1 folder is a backup from the old /home directory so its ok if it overwrites all data.

yeah unmount was a typo.

But what should i try now?
 
Old 06-04-2008, 08:00 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Log out any regular users and log in as root in the console. Since root doesn't need /home for its home directory, you will be able to unmount the /home directory without a problem. Maybe you should even run "sudo /sbin/init S" to switch to single user mode.

If the /dev/sdb1 partition is on an internal hard drive, and this was your home partition before reinstalling, and there is a /home directory but not a /home partition on the new system, then you could edit /etc/fstab to use the /dev/sdb1 and mount it on /home. If there are user home directoroies on the new installation, then consider renaming /home first (eg: sudo mv /home /home-new; sudo mkdir /home) so that you can access both and copy over what you need of the new files or configurations if this is after an upgrade or a distro change. When you are done you can delete the /home-old contents.

If /dev/sdb1 is an external drive, then don't use it as /home. An external drive shouldn't be in /etc/fstab without the noauto mount option. You should also use either "UUID=<UID#>" or "LABEL=<the_disk_label>" instead of the device node. A removable disk may have a different device node the next time you plug it in.
You can create a /home-old directory as a mount point and then migrate what you need over. You could instead change your entry in /etc/passwd to use /home-old/<username> but you won't be able to login if the drive isn't mounted first.

Last edited by jschiwal; 06-04-2008 at 08:02 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting, unmounting? not really getting it..how to they work laucian Linux - Newbie 8 03-23-2008 09:48 AM
Mounting/Unmounting Issues JAlexBrown Linux - Newbie 13 10-03-2007 07:47 AM
Mounting and unmounting in Linux... Tommi Linux - Newbie 3 07-05-2003 08:02 PM
Mounting and unmounting in redhat. Tommi Linux - General 3 04-22-2003 07:08 AM
Mounting and unmounting Hidden Dragon Linux - General 20 09-01-2002 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration