You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Resize+Move root and home partitions with GParted on the same drive

Author (Read 15786 times)

0 Members and 1 Guest are viewing this topic.

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #8 on: July 13, 2017, 08:31:54 AM »
 

gold_finger

  • Documentation Writer
  • Platinum Level Poster
  • *****
  • 1094
    Posts
  • Reputation: 325
  • Linux Lite Member
    • View Profile

  • CPU: Intel Core2 Duo E7500 3.0GHz

  • MEMORY: 4Gb

  • VIDEO CARD: Intel 4 Series Integrated Graphics
You're welcome -- glad things worked out.


P.s.
After glancing back through my first reply above I realized that I had not included the command referenced in this paragraph:
Quote
Long Answer:  Home partition should be fine, but sometimes (more commonly on older computers) having Root so far from beginning of drive may cause system not to boot properly.  If not too much trouble, might be better to change order of partitions to Swap/Root/Home instead of current Swap/Home/Root.  Also, you should not need to have Root partition bigger than it already is (26.7GiB); so any bigger than that would just be a waste of space.  Run this command from a terminal and look at the current "used" space of "/" (root).  It's likely only using between 5-8GB of current available space in root partition.  Even if you installed another 100 programs to LL it wouldn't use up rest of space in Root.
Have edited that post and inserted command I was referring to.
Code: [Select]
df -h
Try Linux Beginner Search Engine for answers to Linux questions.
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #7 on: July 10, 2017, 04:17:42 PM »
 

Roy

  • New to Forums
  • *
  • 36
    Posts
  • Reputation: 2
  • Linux Lite FTW
    • View Profile

  • CPU: intel core i7 4820k

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GTX 970
Thanks for your help I did the first solution after all
Seems the best idea and all the settings are saved in my ~ so it's just ends with me re installing a few more apps again
Thanks again!  ;D
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #6 on: July 08, 2017, 03:14:22 PM »
 

gold_finger

  • Documentation Writer
  • Platinum Level Poster
  • *****
  • 1094
    Posts
  • Reputation: 325
  • Linux Lite Member
    • View Profile

  • CPU: Intel Core2 Duo E7500 3.0GHz

  • MEMORY: 4Gb

  • VIDEO CARD: Intel 4 Series Integrated Graphics
Quote from: Roy
Basically my machine is just 3 years old so I don't think sticking root to the end of the drive will affect it too much.. I mean.. it's working fine as it is now
Yes, it may very well be just fine that way so might as well try that first once you've made backups.  When doing this with GParted from live USB/DVD, do one operation at a time.  Move Root first, hit "Apply" to carry out move.  Then expand Home into resulting free space, hit "Apply" to carry that out.  Close GParted, shutdown live environment, cross your fingers and reboot.  If all went well system should boot as normal with new partition scheme.


If system doesn't boot, use live USB/DVD again to post back here.  Open a terminal and do the following.


List partition structure and partition UUIDs with these two commands and copy/paste full output back here:
Code: [Select]
sudo parted --list
sudo blkid


Mount the Root partition to live environment:
Code: [Select]
sudo mount /dev/sda3 /mnt

Display contents of the fstab file, which shows partitions to mount during boot process:
Code: [Select]
cat /mnt/etc/fstab

Copy/Paste full output of that last command back here as well.

Unmount the Root partition when done:
Code: [Select]
sudo umount /dev/sda3
Try Linux Beginner Search Engine for answers to Linux questions.
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #5 on: July 08, 2017, 02:25:54 PM »
 

Roy

  • New to Forums
  • *
  • 36
    Posts
  • Reputation: 2
  • Linux Lite FTW
    • View Profile

  • CPU: intel core i7 4820k

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GTX 970
Thanks! that actually what I wanted in the first place but compromised for just resizing for the sake of time..
I'll try the easier approach as it'll take me gradually more time to find and understand all the commands. good for practicing but I'll live it for VM  :P
I will try to do this now (after creating a backup of course) and inform here when it is done.
Thanks again  8)

Edit:
On second thought.. I have just read the entire solution and I do want to keep everything (too many programs and settings)
So I will try the harder solution.. first I'll backup everything

Basically my machine is just 3 years old so I don't think sticking root to the end of the drive will affect it too much.. I mean.. it's working fine as it is now
« Last Edit: July 08, 2017, 02:44:03 PM by Roy »
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #4 on: July 08, 2017, 01:37:07 PM »
 

gold_finger

  • Documentation Writer
  • Platinum Level Poster
  • *****
  • 1094
    Posts
  • Reputation: 325
  • Linux Lite Member
    • View Profile

  • CPU: Intel Core2 Duo E7500 3.0GHz

  • MEMORY: 4Gb

  • VIDEO CARD: Intel 4 Series Integrated Graphics
Short Answer:  Everything will probably be okay -- but always a possibility when manipulating partitions that something could go wrong, (especially when moving Root partition).


No matter what you end up doing, make sure you have backup copy of anything important that you don't want to lose.


Long Answer:  Home partition should be fine, but sometimes (more commonly on older computers) having Root so far from beginning of drive may cause system not to boot properly.  If not too much trouble, might be better to change order of partitions to Swap/Root/Home instead of current Swap/Home/Root.  Also, you should not need to have Root partition bigger than it already is (26.7GiB); so any bigger than that would just be a waste of space.  Run this command from a terminal and look at the current "used" space of "/" (root).  It's likely only using between 5-8GB of current available space in root partition.  Even if you installed another 100 programs to LL it wouldn't use up rest of space in Root.


EDIT (Inserted several days later because I see that I forgot to include command that I referred to in above paragraph).  Here is the command I was referring to above:
Code: [Select]
df -h

To change order of partitions, you have two choices -- one much easier than the other (if you're relatively new to Linux and/or not particularly comfortable using the terminal).


Easiest:
  • Boot from live LL USB/DVD, use GParted to delete current Root partition, move Home partition to right leaving approximately 25GB space between it and Swap partition.  Then make new ext4 formatted partition in that space (to serve as new Root partition).
  • Expand Home partition to end of disk.  (Now you'll have small Swap and Home followed by large Home partition.)
  • Once that's done, close GParted and start installer.  Choose "Something Else" (manual) install method.
  • Set new 25GB partition as Root (with mount point "/"), check box to format the partition.
  • Set old Home partition as new Home (with mount point "/home"), but DO NOT format the partition.
  • Installer will automatically setup swap, no need to manually do anything with that partition.
  • Finish install (use same username as you had on old install) and you'll have new system with all data in Home still there.
  • Downside to this is you'll need to re-install any additional programs you may have installed to LL before.
Harder:
  • Boot with live LL USB/DVD, use GParted to move Home to right by approximately 27-28GB.  Cut/Copy/Paste Root partition from end of drive into free space now between Swap and Home.
  • Use series of terminal commands to chroot into moved Root partition, make edits to fstab file and re-install grub to MBR of drive.
  • Time wise this will probably take just as long or longer to do than easy method above.
  • Pro to this is you won't have to re-install additional programs you might have added to LL.
  • P.s.  I've not done this myself, but (in theory) it should work and I could provide instructions if you have a strong aversion to re-installing.
« Last Edit: July 13, 2017, 08:25:21 AM by gold_finger »
Try Linux Beginner Search Engine for answers to Linux questions.
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #3 on: July 08, 2017, 01:24:10 PM »
 

Roy

  • New to Forums
  • *
  • 36
    Posts
  • Reputation: 2
  • Linux Lite FTW
    • View Profile

  • CPU: intel core i7 4820k

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GTX 970
Just move+resize on the same drive
The second image is my target I just making sure here that pressing "Apply" won't destroy anything..
It is safe to hit apply depending on the current configuration?
 

Re: Resize+Move root and home partitions with GParted on the same drive
« Reply #2 on: July 08, 2017, 01:05:25 PM »
 

supergamer

  • Forum Regular
  • ***
  • 163
    Posts
  • Reputation: 27
  • Linux Lite Member
    • View Profile

  • CPU: AMD Phenom 565

  • MEMORY: 12Gb

  • VIDEO CARD: 550 ti
Can you please be more specific. Are you adding in a second hard drive as the unallocated. If your just resizing you should make sure you have a backup of your system then just format the extra to what you want, then copy over the files from the smaller partitions to the new partitions.


https://askubuntu.com/questions/143513/unallocated-space-how-to-resize-home-partition


https://askubuntu.com/questions/28561/how-can-i-add-more-disk-space-to-my-home-directory
 

Resize+Move root and home partitions with GParted on the same drive
« Reply #1 on: July 08, 2017, 05:32:20 AM »
 

Roy

  • New to Forums
  • *
  • 36
    Posts
  • Reputation: 2
  • Linux Lite FTW
    • View Profile

  • CPU: intel core i7 4820k

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GTX 970
Hi all
I have a hard drive (/dev/sdc) with 1TB that my root, swap and home partitions reside in. Recently I've acquired a brand new hard drive and now I have extra space to play with.
My current setup:

And my target is:

Basically that image shows exactly what I want to do.
My question is if I hit "apply" (on a live cd of course) that'll work?
Because those are system partitions I'm a bit afraid everything will be destroyed after the operation complete..

BTW I'll be happy to be informed of a better setup :)

Thanks a lot!
« Last Edit: July 10, 2017, 04:18:24 PM by Roy »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section