You are not logged in.

#1 2017-07-25 09:16:37

deta
Member
Registered: 2017-07-25
Posts: 1

Moving space from one partition to another?

Device     Boot      Start             End                Sectors          Size      Id  Type
/dev/sda1  *          2048             1887438847  1887436800  900G    83  Linux
/dev/sda2              1887438848 1953525167  66086320      31.5G   83  Linux

I'm pretty sure I messed up pretty badly.

Basically, I want to move some of the unused space from /dev/sda1 where I mounted it to "/" to /dev/sda2 which I mounted as "home". This is because I can not install any programs because it is telling me there is not enough space on /dev/sda2 (was trying to install some games on Steam). Do I need to give more information? I'm really confused.

Offline

#2 2017-07-25 09:31:00

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Moving space from one partition to another?

Hi deta, welcome to the forums smile

You can use a gparted live CD/USB to resize partitions.
As always make sure you have backups, as the procedure does carry some risk.
Anything more than 50GB for your root partition is overkill, yours is currently 900GB.

Last edited by Slithery (2017-07-25 09:35:18)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-07-25 11:23:52

imdn
Member
Registered: 2016-04-12
Posts: 40

Re: Moving space from one partition to another?

You cannot 'move' unused space from sda1 to sda2. This is what you'll need to do.

Step 1: Backup contents of sda2  incl. hidden files to external drive (preferred). Since it's only 31.5G, you can also copy it to sda1, but this could cause problems when resizing in step 3.
Step 2: Use gparted from any live CD/USB to delete sda2.
Step 3: Resize sda1 to 100G or less. (This can fail if there is more data on sda1 than 100G , or if there is data on the disk on sectors beyond 100G)
Step 4: Create new sda2 with the remaining free space
Step 5: Restore contents on sda2 from backup
Step 6: Fix your /etc/fstab on sda1 to reflect the new UUID for sda2 (if you used UUID scheme to mount)

Offline

#4 2017-07-25 11:39:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Moving space from one partition to another?

Why bother with all that, why not just...

  • Launch gparted live CD/USB.

  • Resize sda1

  • Resize sda2


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2017-07-25 11:47:59

phw
Member
Registered: 2013-05-27
Posts: 318

Re: Moving space from one partition to another?

+1 for using gparted. Given there is enough room on sda1 (which rpesumable is) gparted can without issues make it smaller, move sda2 to the end and make this larger. gparted will also take care of resizing the file systems.

Just make sure to have a backup, as any partitioning changes are dangerous.

Offline

Board footer

Powered by FluxBB