LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-29-2017, 12:14 AM   #1
Jerry5327
LQ Newbie
 
Registered: Jan 2017
Posts: 5

Rep: Reputation: Disabled
partitions


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.
 
Old 03-29-2017, 12:24 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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
 
Old 03-29-2017, 01:24 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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.
 
Old 03-29-2017, 07:29 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
Old 03-29-2017, 07:36 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
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.
 
Old 03-29-2017, 08:24 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Partitioning/Home/Moving may help.
 
Old 03-29-2017, 10:21 AM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
If there is anything you might want to keep, take a backup first.

Repartitioning can sometimes be inordinately slow when resizing large partitions (up to several hours).
 
Old 03-29-2017, 11:45 AM   #8
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,810
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Quote:
Originally Posted by sundialsvcs View Post
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".
 
1 members found this post helpful.
Old 03-29-2017, 03:55 PM   #9
ceantuco
Member
 
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809

Rep: Reputation: 88
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!
 
2 members found this post helpful.
Old 03-30-2017, 11:41 AM   #10
Peverel
Member
 
Registered: May 2009
Location: Chelmsford, England
Distribution: OpenSuse 12.2 and 13.2, Leap 4.2
Posts: 128

Rep: Reputation: 24
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
 
Old 03-30-2017, 01:14 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Jerry5327 View Post
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?

Last edited by BW-userx; 03-30-2017 at 01:38 PM.
 
1 members found this post helpful.
Old 03-30-2017, 02:33 PM   #12
Jerry5327
LQ Newbie
 
Registered: Jan 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
NAS

I have a raid 1 Synology NAS. Can you have your /home folders on a networked NAS partition?

And if so how do you do it?
 
Old 03-30-2017, 04:18 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
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.
 
Old 03-30-2017, 04:31 PM   #14
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 04-01-2017, 12:37 PM   #15
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Rep: Reputation: Disabled
Quote:
Originally Posted by Jerry5327 View Post
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.
 
1 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
[SOLVED] what is a logical partitions and group partitions and how to check disk space on a partition ITareliteralyMyInitials Linux - Newbie 10 02-08-2016 11:19 AM
rebuild partitions/label from existing partitions - used parted on wrong drive zedmelon Linux - Software 4 07-26-2013 03:42 PM
[SOLVED] Is it safe to resize my Slackware partitions after removing my Mint 10 partitions? Robert.Thompson Slackware 19 02-18-2011 11:47 AM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac SUSE / openSUSE 1 12-20-2006 05:02 PM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 AM.

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