View Full Version : [ubuntu] Move /home to partition

April 5th, 2017, 04:03 PM
I bought a new laptop from Dell with Ubuntu 16.04 LTS installed in a single partition. I want to boot via cd and use gparted to shrink the partition. I want to wind up a boot partition, a system partition, a swap partition, and a /home partition.

I want to do things the simple way and would appreciate a cookbook step by step. One of my main questions is how to move /home to the new home partition so the system will recognize where it is.

I know I can wipe everything out and do a complete reinstall but that is not the way to go. Besides, Dell may havbe a special version of Ubuntu with special drivers. I do not know. My laptop is being delivered mid April.

April 5th, 2017, 04:22 PM
You will get a /efi/, /, and swap at a minimum. The other things /usr/, /var/ aren't necessary, IMHO. In the days of 1G of storage, having those things on separate storage made complete sense - /var would be local and /usr would often be over NFS. Just isn't necessary these days. A case might be made for /var/ on a separate partition, but not if you have 20G+ storage. Complex partitioning is likely to lead to wasted storage in a partition that doesn't need it.

Moving /home to a new partition isn't hard. Use the usermod command. There are options to move a HOME. It would be easier if you just mounted the storage for HOME somewhere else leaving /home/ empty on the older partition. The usermod manpage has all the details. Think you want the -d and -m options. Maybe a few others. https://linux.die.net/man/8/usermod - but be certain to check the manpage for your specific system. Sometimes options change. In ubuntu, usermod will move all the files and modify the passwd db for you. Very simple. No need to do it the hard way anymore (I've learned this in the last 3 months).

Current generation computers will come with uefi and GPT partitioning. GPT partitioning is a vast improvement over the old MBR/MS-Dos partitioning methods. No more "extended partitions" or "logical partitioning" due to limitations. GPT allows hundreds of primary partitions - no hassles. Also, GPT has 2 copies of the partition table at opposite ends of the drive instead of next to each other. This protects against failures in nearby sectors.

The move-home-directory question is asked here a bunch. Do a little searching for steps about mounting the partition to a new directory (mount points are usually just an empty directory). /u/ or /h/ would be common inside enterprises for HOME directories. Using /home/ really isn't important, just convention. If the passwd db has the correct HOME, then all references to $HOME and ~userid and ~/ will work for anyone on the machine.

Dell would include the correct drivers. Some of those might be proprietary. Hopefully, they are dkim enabled.

April 5th, 2017, 04:29 PM
This has the step by step process to move /home.
To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions

I prefer to use /mnt/data for just folders in /home, but keep all of the mostly hidden user configuration settings in /home inside /. And I normally use about 25GB for / but only actually use less than half of it. I also do move some hidden folders with lots of data like Firefox & Thunderbird profiles. But my / is on SSD & data on HDD. And I have multiple installs, so that is why a /mnt/data may make more sense for me.

Dell develops sputnik which usually is later incorporated into Linux & then distributions. I did read somewhere that first sputnik for 12.04 was all in 14.04.

Dell support - Update on XPS 13/15 2016 Developer Edition availability
Kernel 4.6 has Dell & Alienware improvements including 9350
Dell XPS 13 Developer Edition New Kaby Lake 16.04 Sputnik
5th Generation Sputnik
New Haswell Sputnik - Dell orbits Linux a third time with revamped Sputnik notebooks

April 5th, 2017, 07:58 PM
I recommend making /boot a primary partition and allocating the rest of the drive to an extended partition.

April 5th, 2017, 08:23 PM
With UEFI and gpt partitioning there is only one type of partition or in effect all partitions are primary.
And with MBR you have the 4 primary partition limit or why if MBR you need extended partition. But with gpt you have a soft limit of 128 "primary" partitions. But if you want more there supposed is a way to change even that.

GPT Advantages (older 2010 but still valid) see post#2 by srs5694:
UEFI Advantages