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.
I purchased a Dell laptop (will receive it in April 2017) with Ubuntu 16.04 LTS installed in a single partition. I want to use gparted to shrink the partition to (not sure what size but thinking about a 1/4 TB and creating a second partition with the remainder. I would like to have my home folder on that 2nd partition.
What do I have to do (as simple as possible) to get Ubuntu to point to and
recognize that the Home folder is moved and how do I move it?
Prepare yourself by using your favourite search engine. Ubuntu (self-)help is exceptionally well documented on the web. If you have concerns re something you find, post back (with a link) so someone can comment specifically.
Use of a gparted liveCD is best.
Last edited by syg00; 03-29-2017 at 07:31 AM.
Reason: "liveCD" missing
at first, be care about that, because you may destroy your ubuntu completely (although it is not a "big" problem, because you can reinstall it any time, if you have an install cd/pendrive in your hands).
second, you cannot shrink the root partition of a living/working system, you ought to boot a live CD instead (the one I mentioned before).
third, choose your preferred method to resize it - gparted is a good choice - look for a link/description/howto and ask if that was unclear or you are in doubt.
I think that is best done when you first get the system. Agree with the cautionary thoughts already offered. Also would note two things (1) there is a way to tell the system that a user's /home directory is elsewhere and then not specifically move the /home partition (2) If you intend to move the user's /home directories, why place it on the same physical disk? I'd put it on a different disk because I prefer to separate system from user.
I would go now and purchase a retail copy of Windows Pro, wipe the sucker clean of anything and everything that Dell stuck on the box, and repartition it as you like. (Don't buy "Home Editions.")
"OEM" copies – especially from Dell – are not "the real deal." At the worst possible time you might even find that their disk doesn't work, or that it will reset everything to some "default configuration" that you didn't specify and that you have no control over. Spend the money to buy an independent copy. This is also an excellent time to reformat the drive and to run SMART diagnostics. This will cause the drive to rewrite all of the data and thus to examine every spot. Yes, it will take a long time.
Last edited by sundialsvcs; 03-29-2017 at 07:37 AM.
I would go now and purchase a retail copy of Windows Pro, wipe the sucker clean of anything and everything that Dell stuck on the box, and repartition it as you like. (Don't buy "Home Editions.")
How would that help anyone with Ubuntu pre-installed (e.g., OP), or anyone who wants only Linux on his Dell?
Quote:
"OEM" copies – especially from Dell – are not "the real deal." At the worst possible time you might even find that their disk doesn't work, or that it will reset everything to some "default configuration" that you didn't specify and that you have no control over. Spend the money to buy an independent copy.
That's completely counter to my experience with genuine Dell installation media. AFAICT, the Dell media I have differ from generic Windows media only in being able to install Windows successfully without having to input any key. e.g.
P/N D0V2K, Windows 7 Professional SP1 64 bit, "Reinstallation DVD".
I would use clonezilla to create an image file of the entire hard drive.
Download Ubuntu
Do a clean install so you can create your own partitions. If it does not work well, you can always re-image your hard drive. Cheers!
I don't know Ubuntu, so I can only make general comments. To do what you suggest you will want to shrink your current partition (using as suggested, gparted on a cd or dvd, allocate the rest of the disk as what will be /home and create a file system on it. Then the difficult bit starts. You would want to copy your current home folder. it is called /home/username, to the new partition and alter your boot procedure to mount the new partition on /home at boot time. This mean modifying system files, possibly one called fstab.
If you do a new clean install, this is all done for you by the installer. So I would go with ceantuco's solution. If you want to be safe, you could shrink your current partition and install a new copy of Ubuntu on the rest, using a separate /home. Installing Grub2 allows you to choose whether you use the old or new distribution. If all goes well, you can scrap the old partition.
By the way, if you have a separate /home, then / only contains system and run-time files, probably 10-20GB, or 20-40GB if BTRFS is used. Mine currently is 29GB, which is adequate. So 1/4TB really is overkill.
Last edited by Peverel; 03-30-2017 at 11:42 AM.
Reason: literals
I purchased a Dell laptop (will receive it in April 2017) with Ubuntu 16.04 LTS installed in a single partition. I want to use gparted to shrink the partition to (not sure what size but thinking about a 1/4 TB and creating a second partition with the remainder. I would like to have my home folder on that 2nd partition.
What do I have to do (as simple as possible) to get Ubuntu to point to and
recognize that the Home folder is moved and how do I move it?
Thanks in advance.
Oh Ubuntututu ....
if it was not Ubunututu it'd be sooo easy.
Log in ROOT user. open gparted. resize .... nope. got a be unmounted to play with partitions like that.
boot live Linux OS with gparted or boot a gparted USB stick.
resize partition.
created a new partition with new raw part ext4 or whatever type you want.
Quote:
check fstab for new UUIDs to root or the moved OS partition.
sudo blkid gets you UUIDs then cat your fstab for check to be sure they are still the same.
reboot your system. log in root user, (NOT UBUNTUTUTU) you'll have to fiddle with that one. Ubuntututu style or login user to su -
should get you root.
as your fstab should still mount your old /home
mount /new/partiton /mnt
mkdir -p /mnt/home/username
move or copy your home contents into the new /home/user
cp -rv /home/user/* /mnt/home/user/
chown userName:groupName /mnt/home/userName -R
just to be on the safe side. it only takes a minute or two.
if using UUID again get the new UUID for your new partition.
sudo blkid
change it in your fstab to reflect the new UUID. that should be the only thing you'll have to change, or you can comment it out and write a entire new line for it
UUID /home file type options dump code and fsck code
save - reboot
log in to your new home
any thing goes wrong LQ here to help.
I'm going on a three day break j/k
P.S. if all goes well, which it should, do not forget to ensure that all of your hidden files have been moved, or you can just let the system recreate them when you start an app.
2. if you copied them then do not forget to get rid of them as you'll be mounting the new /home on different partition so that old home will just disappear even though it will still be there with your stuff in it.
so Q:
what would you do to remove the contents in your old home prior to actually moving into your new home AFTER you've ensured everything you need has been relocated to your new home so you can regain that space for your system side?
50 pt brain teaser.
Q2:
if you
Code:
deluser -r userName
to get rid of that old user directory and its contents before rebooting to mount your new home. then what problems will you cause yourself?
Doubt it but guess you could run into a uefi issue.
Not really a big deal if you mess it up I'd think in any choice of options. Should be rather easy to just take an install media and make what you want. Pretty sure Dell should be 100% native Ubuntu but you never know. Could have some junk in it.
Heck, it would be good learning anyway for you to just reload it as you wish from scratch. May have to do it sooner or later. Better now and know how to recover.
You can have /home/user or just /home anywhere you want. The only condition is it has to be available before user logs in. Use vipw command as root to edit the location of users home.
What do I have to do (as simple as possible) to get Ubuntu to point to and
recognize that the Home folder is moved and how do I move it?
That sounds complicated.
In my view, I'd save everything on the /home folder onto a seperate partition.
Then install a new Ubuntu OS onto 'unallocated space' on the HDD. During the install wizard, you can then choose to have /root and /home on separate partitions.
After the successful install of the new Ubuntu OS, transfer your saved files (which is located on a different partition) onto your new /home partition.
Just seems simpler that way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.