Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.............
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.
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.
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).
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/.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.