[SOLVED] home folder is in root rather than its own partition
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
home folder is in root rather than its own partition
I have been setting up my new Slack setup on the PC, however, my home folder was supposed to be on its own partition. It looks like it's ended up in root.
root@psychopig-xxxiv:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 74.5 GiB, 80026361856 bytes, 156301488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x760c1513
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 62916607 62914560 30G 83 Linux
/dev/sda2 62916608 73402367 10485760 5G 82 Linux swap
/dev/sda3 73402368 156301487 82899120 39.5G 83 Linux
Last edited by Lysander666; 07-30-2018 at 05:43 PM.
Assuming that /home is now properly mounted at /dev/sda3, (Check this with mount)the contents of /home that you had before the fix are likely mounted underneath /dev/sda3 now. You will probably find them if you umount /home.
Assuming that /home is now properly mounted at /dev/sda3, (Check this with mount)the contents of /home that you had before the fix are likely mounted underneath /dev/sda3 now. You will probably find them if you umount /home.
I think the rm -r /home should actually be rm -r /home/* because you still need the directory there to mount a filesystem onto it and just want to remove its contents.
I think the rm -r /home should actually be rm -r /home/* because you still need the directory there to mount a filesystem onto it and just want to remove its contents.
Yes, you are probably right about that. Maybe it would be ok because /home is fstab, but I have not tested this and is only conjecture.
Your edit is definitely the way to go though, just to be safe. Good catch!
Have you addressed this question from @Skaendo yet?
You may well have a partition at /dev/sda3 (as reported by fdisk) but is it formatted? If it is formatted, you should be able to mount it manually somewhere to check. Are you able to mount it manually somewhere? e.g. mount /dev/sda3 /mnt/tmp
If not, run mkfs -t ext4 /dev/sda3
then try mounting again.
Have you addressed this question from @Skaendo yet?
Quote:
Originally Posted by Skaendo
Why does /dev/sda3 look like it's not formatted?
When doing the install, though sheer laziness I formatted sda1 but not sda3. I'm guessing this is the reason for what's happened here.
Quote:
Originally Posted by glorsplitz
Do you mean you have a folder /root/lysander ?
I think that's what's happened. I can't check till I get back to the install though.
Quote:
Originally Posted by TheEzekielProject
Assuming that /home is now properly mounted at /dev/sda3, (Check this with mount)the contents of /home that you had before the fix are likely mounted underneath /dev/sda3 now. You will probably find them if you umount /home.
There's nothing specific that distinguishes a directory under which you mount something from one used for something else. You can call mountpoints whatever you wish, just make sure you use the right path everywhere.
On a more general note, user home directories don't really have to be under /home, either (and you can run a system without a /home directory, too), it's just a convention. But a fairly important one (important enough that it deserves its own entry in a manpage -- see man hier ).
OK, thanks to both of you. I imagine after carrying out Ezekial/bass's instructions I should be, theoretically, looking at a setup as intdned, which is
sda1 /
sda2 /swap
sda3 /home
/home being under my user /home/lysander
I imagine I will have to tell the OS that is should be /home/lysander but we'll see.
EDIT: I may use UUIDs for each partition in fstab. This will be useful for later when I attach more internal hard drives.
I imagine I will have to tell the OS that is should be /home/lysander but we'll see.
No no . Here's how these things go.
There is a directory called /home under which, traditionally, all the user home directores (/home/adunr, /home/lysander etc.) are traditionally created. (Edit: to clarify: a user's home directory (e.g. /home/lysander) is not the same thing as the system's /home directory (which is, well, /home).)
The system "knows" what a user's home directory is via the records in /etc/passwd. For example, this record tells the system that adun'r home directory is /home/adunr:
Code:
adunr:x:1000:1000::/home/adunr:/bin/mksh
Several users can have their home directories under /home:
but not all users' home directories are under /home:
Code:
gopher:x:619:619::/srv/gopher:/sbin/nologin
Now, for reasons that have to do with space, credentials and fsck management mostly, it's often considered a good idea to have /home on a separate partition than /. That's a different concept from the one above: via fstab, we tell the system to mount a certain partition (/dev/sda3, in your case) under /home.
As far as the parts of your system doing the mounting are concern, /home has no special meaning. You can add any kind of record, for any kind of device, under fstab. It doesn't need to be one of the "standard" locations in the standard hierarchy. All fstab contains is a bunch of records saying "mount these partitions with these options at these mount points". It doesn't really matter which ones -- and while some of these filesystems may have particular meanings to other parts of your system (e.g. procfs), their wider significance is of no importance in fstab.
So:
/dev/sda3 gets mounted under /home as per the instructions in fstab, and that's where the OS will normally host user home directories
Your user (lysander) will have its home directory under /home/lysander , as per the instructions in /etc/passwd
The two concepts are independent of each other. The system doesn't care (but see note below) if stuff under /home is on a different partition or not -- maybe you have something mounted under it, maybe you don't.
NOTE: this mostly applies to relatively late runlevels. Early at boot time, e.g. when initrd is loaded, whether or not a partition is mounted can and often does matter. That's a hairy business. But by the time your system cares about stuff under each user's home directory, /home should be long mounted .
Later edit: ah, yes -- UUIDs are definitely preferable, especially when pluggable devices are involved. I have a desktop where I still use static device names out of habit, and it's easier to explain things with device files rather than UUIDs, but that ship has long sailed when it comes to real-life use .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.