Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I installed Linux on SSD and mounted /home to another drive. How can I swap /home to /root?
Some clarification on terminology:
/home = home partition housing user directories
/root = /root's personal user directory
/ = the root partition.
I would not move /home to /root - it would be a permissions nightmare.
If you want to move the contents of your home partition to /, log out all users except root, [if there's no root login, use 'su -' as some user] choose some empty directory in /mnt or /media (I will use /mnt/tmp in the example) then do something like
Code:
# mount -o remount </home device, e.g, /dev/sdb1> /mnt/tmp
# cp -a /mnt/tmp/* /home && sync
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363
Rep:
... ABSOLUTELY in agreement with business_kid's comments ... Unless I'm misunderstanding your question, what you are suggesting is at best very unusual and potentially destabilizing.
If you could explain what you are attempting to accomplish, it may make it easier for members to provide helpful answers and advice.
I'm just swapping /home and /root. I want to move /root not / (I know). I didn't see mount point /root on installation so I use /home instead now I want to swap it with /root.
Maybe I'm missing something here, but it seems like a rather simple task that could be done by booting off a live medium, then, as root mounting the drives containing /home and /root, making any moves, and, finally, adjusting ownerships and permissions.
On second thought, back up /home and /root before trying to pull off the switch.
You really really really do not want to move /home to /root. I'm not even going to begin to say how to do that, because it's crazy how much of a bad idea it is and what weird stuff would be necessary to actually do it.
Instead, I'll tell you what you really want to do:
1) Log out with all regular users (if any are logged in).
2) Log in as root on a console (ctrl-alt-f1 to get to the text console login; ctrl-alt-f7 to get back to the GUI login)
I'm assuming you're not running Ubuntu or any Ubuntu derivative. If so, then yippee! You've just discovered one of the reasons doing things the Ubuntu way is dumb. (I think that if you are running an Ubuntu derivative, making it so you can log in as root is "sudo passwd"...prepare for confusion about the passwords it's asking you though...)
3) While logged in as root, do the following commands:
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363
Rep:
Quote:
Originally Posted by dalvikvm
I'm just swapping /home and /root. I want to move /root not / (I know). I didn't see mount point /root on installation so I use /home instead now I want to swap it with /root.
IsaacKuo has detailed instructions in an above post as to how to go about doing something different than what you are asking. With respect, I would recommend you consider his alternative and definitely rethink your plan.
As mentioned earlier, the /root directory is the "root" user's home directory ... Moving or copying anything into this is an unusual thing to want to do and I am not convinced you are aware of the potential impacts and permissions issues involved.
I do apologize for insisting, but a bit more detail might help members here understand your motivation for suggesting this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.