LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I modified fstab to have /home in separate partition (didn't work) (https://www.linuxquestions.org/questions/linux-newbie-8/i-modified-fstab-to-have-home-in-separate-partition-didnt-work-4175433273/)

Master_CAPS 10-20-2012 04:48 PM

I modified fstab to have /home in separate partition (didn't work)
 
My setup (fdisk -l):
Code:

Disk /dev/sda: 250.1 GB, 250058268160 bytes, 488395055 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
Disk identifier: 0x24852de5

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          63    1992059      995998+  83  Linux
/dev/sda2        1992060    5992244    2000092+  82  Linux swap / Solaris
/dev/sda3        5992245  105996869    50002312+  83  Linux
/dev/sda4      105996870  488395054  191199092+  5  Extended
/dev/sda5      105996933  297186434    95594751  83  Linux
/dev/sda6      297186498  488395054    95604278+  83  Linux


Also my fstab file (I ADDED THE LAST TWO LINES) IF i COMMENT OUT THE LAST TWO LINES MY SYSTEM WORKS FINE "i'm not yelling ;)"
Code:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>        <type>        <options>        <dump>        <pass>
tmpfs                /tmp        tmpfs        nodev,nosuid        0        0
# UUID=0095b0a5-1961-4f62-af20-cfdedacca5a7
/dev/sda3                  /                ext4              rw,relatime,data=ordered        0 1

# UUID=2dfffb8e-e722-42ae-b350-335a9b798972
/dev/sda1                  /boot            ext4              rw,relatime,data=ordered        0 2

# UUID=a5368509-c4ab-415e-a15c-c22f80107405
/dev/sda2                  none              swap              defaults          0 0

#my notes:
#remeber that sda5 and sda6 are last logical parations of sda4 and are each about 95gb

#This sets logical sda5 as the  /home directory (I hope)
/dev/sda5                /home                ext4                defaults,rw,realtime,data=ordered        0 2

#This sets logical sda6 as the  /usr directory (I hope)
/dev/sda6                /usr                ext4                defaults,rw,realtime,data=ordered        0 2



I really, REALLY would like to have /home and /usr on a separate partition, (please don't call me weird, but I would like to encrypt /home and /bin. Maybe not /bin but definately /home!)

If it helps I did this:
sda1 (primary boot/grub ext4)
sda2 (primary swap/type82)
sda3 (primary Arch ext4)
sda4 (extended)
sda5 (logical ext4)
sda6 (logical ext4)

And yes I mounted sda5 and sda6 to copy all contents from /home and /usr to the mount point, added lines to fstab, and rebooted (forgot to unmount but whatever); upon reboot I got grub to load, I selected Arch, and my screen tuned to static/fuzz/colors

I was able to put the Arch instillation disk and mount sda3 and enter the root environment, comment-out the lines I added and it works as normal upon reboot (of course /home and /usr just on sda3 also and not where I wish they were :( )

I have tried to read-up on the arch-wiki and forums, and its tough switching from windows to linux but ive managed to install arch and figure out most things but this is the only thing in my way now... Thanks for your help!

seeberg 10-20-2012 05:13 PM

Did you use cp or cp -a when copying

suicidaleggroll 10-20-2012 05:21 PM

Adding it to fstab should be the last step, only after it's been verified to work.

To migrate /home onto a separate drive/partition:

1) Log out of your user
2) Use one of the Ctrl+Alt+F# TTYs to log in as root
3) Verify that NO users are logged in with "w"
4) mount sda5 to a temporary location
4) rsync -a /home to your mount point for sda5
5) Move /home to a backup (/home.bak for instance)
6) Make an empty /home directory for your new mount
7) Unmount sda5 and re-mount it at /home
8) Make sure everything in /home looks correct (eg: make sure everything isn't located in /home/home/, which is indicative of bad syntax in the rsync command)
9) Try and log in as a regular user
10a) If successful, commit the mount to fstab, restart, and test it again
10b) If unsuccessful, switch back to your root TTY and check the logs to see why.

mreff555 10-20-2012 06:49 PM

Quote:

Originally Posted by suicidaleggroll (Post 4811027)
Adding it to fstab should be the last step, only after it's been verified to work.

agreed.

Did I miss what the actual error was?

regardless, your entry in /etc/fstab looks more or less correct. (running in realtime is a little safer, but significantly slower)

and there is nothing wrong with running /home or /usr on separate partitions, but why do you want to encrypt /bin?

I would remove the changes from fstab. check to see that you can mount your partitions manually. Make sure the permissions are correct.
when copying archives like that you should use "cp -a" "install" or "dd"

TobiSGD 10-20-2012 07:28 PM

Have you read the relevant paragraph in the ArchWiki about using a separate /usr? https://wiki.archlinux.org/index.php...tioning#.2Fusr
A modification of your initrd is needed to get that running.

jschiwal 10-20-2012 07:37 PM

TobiSGD: is that Arch specific, or has arch moved all /bin and /sbin files to /usr/bin & /usr/sbin? My initrd file has libraries & modules in usr/ without a separate /usr partition.

syg00 10-20-2012 07:39 PM

Quote:

Originally Posted by Master_CAPS (Post 4811011)
I have tried to read-up on the arch-wiki and forums, ...

Good; persevere with trying to get a handle on it - Arch has some great doco. See @TobiSGD link - read the entire article, and related links.

As an aside, whenever screwing around with fstab, run a "mount -a" command before you reboot. It'll tell you if you messed up. Most of the time - I suspect it wouldn't have helped in this case.

TobiSGD 10-20-2012 07:54 PM

Quote:

Originally Posted by jschiwal (Post 4811074)
TobiSGD: is that Arch specific, or has arch moved all /bin and /sbin files to /usr/bin & /usr/sbin? My initrd file has libraries & modules in usr/ without a separate /usr partition.

AFAIK this is because Arch has moved to symlinking /bin and /sbin to /usr/bin and /usr/sbin, so any distro that has done that also needs the same modifications.

Master_CAPS 10-20-2012 09:07 PM

I wanted this to go smooth so I actually deleted all partitions and re-installed arch from scratch, and at this point there isnt even a gui (xserver/xorg/kde/kdm...).

After reading your posts im not going to worry about /usr and will only be focusing on moving /home to sda5
I am able to mount sda5 and at this point there isnt anything in my /home dir b/c its a fresh arch install for now. (nothing to copy yet)
But I think im wayyy in over my head I dont really know how this works (like even if it does work will I have to mount it? or does fstab auto mount and redirect all /home to the new home in sda5)

Could I delete /home in sda3 and put a symbolic /home that really points to a mounted sda5?

jschiwal 10-20-2012 09:42 PM

You don't delete the /home directory. It's where the partition is mounted on. It would be better to rename it and create a new one, when moving /home. Starting from scratch, you don't need to do it. An advantage of having /home on it's own partition is to be able to reinstall without reformatting the old /home.


All times are GMT -5. The time now is 05:12 PM.