LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-30-2018, 05:37 PM   #1
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
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.

This is fstab:

Code:
/dev/sda2        swap             swap        defaults         0   0
/dev/sda1        /                ext4        defaults         1   1
/dev/sda3        /home                        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0

Should I change sda3 to /home/lysander?

And df -h

Code:
lysander@psychopig-xxxiv:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G   11G   18G  37% /
devtmpfs        2.5G     0  2.5G   0% /dev
tmpfs           2.5G  1.1M  2.5G   1% /run
tmpfs           2.5G   58M  2.4G   3% /dev/shm
cgroup_root     2.5G     0  2.5G   0% /sys/fs/cgroup
cgmfs           100K     0  100K   0% /run/cgmanager/fs
lysander@psychopig-xxxiv:~$
 
Old 07-30-2018, 05:39 PM   #2
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Why does /dev/sda3 look like it's not formatted?
 
Old 07-30-2018, 05:41 PM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178

Original Poster
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Quote:
Originally Posted by Skaendo View Post
Why does /dev/sda3 look like it's not formatted?
Something is wrong here. The setup is supposed to be something like:

sda1 - / - 30G
sda2 - /swap - 5GB
sda3 - /home - 40GB

Hmmmm.

Code:
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.
 
Old 07-30-2018, 05:43 PM   #4
BigTig
Member
 
Registered: Aug 2015
Posts: 61

Rep: Reputation: Disabled
try changing this:
/dev/sda3 /home defaults 1 2

to this
/dev/sda3 /home ext4 defaults 1 2
 
1 members found this post helpful.
Old 07-30-2018, 06:12 PM   #5
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178

Original Poster
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
I did the above and restarted.

This is odd, the third partition has no UUID. Does anyone have any ideas as to what is going on here?

Code:
lysander@psychopig-xxxiv:~$ ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 80 Jul 31  2018 .
drwxr-xr-x 4 root root 80 Jul 31  2018 ..
lrwxrwxrwx 1 root root 10 Jul 31 00:11 3973ae50-15b7-4d57-a211-54b4cf951506 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 31 00:11 ff624ae7-b3d4-4ef5-887a-8d505669bfd0 -> ../../sda1
EDIT: solved this by formatting the partition

Code:
lysander@psychopig-xxxiv:~$ ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 100 Jul 31 00:16 .
drwxr-xr-x 4 root root  80 Jul 31  2018 ..
lrwxrwxrwx 1 root root  10 Jul 31 00:11 3973ae50-15b7-4d57-a211-54b4cf951506 -> ../../sda2
lrwxrwxrwx 1 root root  10 Jul 31 00:16 3a2a529f-9216-43f6-9458-ae64cca849a2 -> ../../sda3
lrwxrwxrwx 1 root root  10 Jul 31 00:11 ff624ae7-b3d4-4ef5-887a-8d505669bfd0 -> ../../sda1
Still need to move /home though.

Last edited by Lysander666; 07-30-2018 at 06:21 PM.
 
Old 07-30-2018, 07:39 PM   #6
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,309

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
I don't understand.

/home is on partition /dev/sda3

/ is on partition /dev/sda1

what does mount show?

Do you mean you have a folder /root/lysander ?

What is under /home?
 
Old 07-30-2018, 08:19 PM   #7
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
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.

The easiest way to fix this is probably to just
Code:
umount /home
mount /dev/sda3 /mnt/newhome
rsync -rP /home /mnt/newhome
rm -r /home
reboot
 
Old 07-30-2018, 11:50 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by TheEzekielProject View Post
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.

The easiest way to fix this is probably to just
Code:
umount /home
mount /dev/sda3 /mnt/newhome
rsync -rP /home /mnt/newhome
rm -r /home
reboot
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.
 
2 members found this post helpful.
Old 07-31-2018, 12:13 AM   #9
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by bassmadrigal View Post
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!
 
1 members found this post helpful.
Old 07-31-2018, 02:50 AM   #10
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 916

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by Skaendo View Post
Why does /dev/sda3 look like it's not formatted?
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.

chris
 
Old 07-31-2018, 03:25 AM   #11
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178

Original Poster
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Quote:
Originally Posted by glorsplitz View Post
/home is on partition /dev/sda3
Apparently so, but it is not symlinked properly.

Quote:
Originally Posted by chris.willing View Post
Have you addressed this question from @Skaendo yet?
Quote:
Originally Posted by Skaendo View Post
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 View Post
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 View Post
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.

The easiest way to fix this is probably to just
Code:
umount /home
mount /dev/sda3 /mnt/newhome
rsync -rP /home /mnt/newhome
rm -r /home
reboot
Great instructions and thanks for your input too, bass.

Should the mount point literally be called newhome?

Last edited by Lysander666; 07-31-2018 at 04:36 AM.
 
Old 07-31-2018, 03:33 AM   #12
adunr
Member
 
Registered: Feb 2018
Location: Who knows?
Distribution: Slackware, OpenBSD, Arch
Posts: 33

Rep: Reputation: Disabled
(Note: I'm not OP)

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 ).
 
1 members found this post helpful.
Old 07-31-2018, 03:34 AM   #13
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You could call it Rupert if you want ...

It's just somewhere to mount the partition so you can copy the existing contents of /home into it.
 
1 members found this post helpful.
Old 07-31-2018, 04:33 AM   #14
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178

Original Poster
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
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.

e.g.

Code:
UUID=3973ae50-15b7-4d57-a211-54b4cf951506       swap             swap        defaults         0   0
UUID=ff624ae7-b3d4-4ef5-887a-8d505669bfd0        /               ext4        defaults         1   1
UUID=3a2a529f-9216-43f6-9458-ae64cca849a2        /home           ext4        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0

Last edited by Lysander666; 07-31-2018 at 05:00 AM.
 
Old 07-31-2018, 05:00 AM   #15
adunr
Member
 
Registered: Feb 2018
Location: Who knows?
Distribution: Slackware, OpenBSD, Arch
Posts: 33

Rep: Reputation: Disabled
Quote:
Originally Posted by Lysander666 View Post
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:

Code:
adunr:x:1000:1000::/home/adunr:/bin/mksh
natls:x:1001:1001::/home/natls:/bin/bash
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 .

Last edited by adunr; 07-31-2018 at 05:05 AM.
 
2 members found this post helpful.
  


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
extracting root folder to a user home folder command mzein1292 Linux - Newbie 3 06-23-2015 07:26 AM
Is there any benefit of making a separate partition for home, root and boot partition Vexe Linux - Hardware 18 02-23-2013 11:00 AM
[SOLVED] Seperating Home folder from Root Folder to a new partition. baxzius Linux - Newbie 5 08-01-2011 03:26 PM
new home folder on new partition njac Linux - General 2 07-04-2008 09:46 AM
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:37 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