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.
Hi. Is there anything special about a home directory before users' home directories are stored there, or is just as typical as any other "empty" folder?
Let me just cut to the chase, but please no ear ringing about the folly of messing around as root, particularly with directories at root level. I know it's considered stupidity, but I deleted my home directory.
Is there an easy way to restore a working home directory? I tried copying /etc/skel under root, but I'm not sure what a home directory should look like once it has been restored. Besides . & .., there were .screenrc & .xsession in my home directory when I copied /etc/skel. Are these files suppose to be in "/home" or "/home/~" or both?
First, /home contains all of the user's directories... as in there is a folder for each user corresponding with their username in /home. So my /home is really "/home/keithieopia" You shouldn't really need to copy anything from "/etc/skel" most Linux applications will create whatever file they need automatically in your home directory... but better safe that sorry.
So if your deleted your /home/USERNAME type the following commands as root to fix it (replace USERNAME with your actual username):
Then logout as root and login as the username you usually use. Everything should be fine. If not, post any errors you get here. A special note too, root lives in "/root" and not "/home/root"
So with your two files (most likely not needed) it would look like:
/home/USERNAME/.screenrc
/home/USERNAME/.xsession
Last edited by keithieopia; 06-19-2010 at 08:27 PM.
Reason: Copy stuff from skel
Erm... if you deleted "/home" then everything under "/home" such as "/home/keithieopia" is also deleted. Did you do one of these: "rm -r"? If so, that's the case. You'll need to just "mkdir /home" before the rest of my instructions:
Or to directly answer your question, "/home" is just a folder with 755 permissions. However .xsession and .screenrc should not have been in the /home folder but a /home/USERNAME folder. Not sure why they were there.
Last edited by keithieopia; 06-19-2010 at 08:58 PM.
Reason: screenrc in /home confusion
It should be doable by messing around with you /etc/fstab file. Theoretically, in Linux, you can mount any drive partition to any empty folder. It all depends on exactly what you want to do with this, and the permissions you assign to both the folder you created and the partition to be mounted. Look up the 'mount' command (man -k mount or info mount) Hope you get your system back up and running!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.