You are not logged in.

#1 2015-05-24 04:16:06

eduncan911
Member
Registered: 2015-05-02
Posts: 93
Website

[RESOLVED] Partition: Unallocated Space, can't resize to use it

Loving my arch install that has taken me about a month to get used to.  Therefore, I don't want to loose it but unfortunately I've did something non-standard when I setup my partitions and need to fix it.

$ sudo parted /dev/sda print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 129GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  538MB  537MB  fat32              boot, esp
 2      538MB   128GB  127GB  ext4
$ lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   120G  0 disk 
├─sda1   8:1    0   512M  0 part /boot
└─sda2   8:2    0 118.5G  0 part /

To start, I have about a 120 GB disk I've setup for my EFI install.  Everything is working fine.

Except, my ext4 filesystem is only 25GB in size:

$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        24G   12G   12G  50% /

Loading Gparted, it gives me a warning that /dev/sda2 has ~92 GB of Unallocated space and tells me to run "Partition -> Check" to fix it.

Except, "Check" is disabled/grayed out.

So, I'm trying to boot off of the Arch live CD and use "parted" to fix it. 

There is no "check" option (it was removed).

What's the CLI "parted" equivalent to Gparted's "check" option?

Or if there's another way to resolve this, please let me know!

Last edited by eduncan911 (2015-05-24 04:50:01)

Offline

#2 2015-05-24 04:18:59

Aerial Boundaries
Member
Registered: 2015-05-15
Posts: 26

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

I'm a newbie my self and I can't offer much help, but isn't this the command you are looking for?

http://www.gnu.org/software/parted/manu … html#SEC13

Offline

#3 2015-05-24 04:21:44

eduncan911
Member
Registered: 2015-05-02
Posts: 93
Website

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

Aerial Boundaries wrote:

I'm a newbie my self and I can't offer much help, but isn't this the command you are looking for?

http://www.gnu.org/software/parted/manu … html#SEC13

I found that, yep.  But that's for parted version 2.  They removed "check", along with several other commands like "resize" in version 3+.

And Arch has 3.2-2 at tip.

Offline

#4 2015-05-24 04:23:55

Aerial Boundaries
Member
Registered: 2015-05-15
Posts: 26

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

Oh silly me.

This is from the v3 man:

http://www.gnu.org/software/parted/manu … _002dcheck

so the command is align-check now

Offline

#5 2015-05-24 04:27:20

eduncan911
Member
Registered: 2015-05-02
Posts: 93
Website

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

Well crap, i already ran that (for both min and opt) and it said "aligned" both times.

So, Check doesn't do it... Humf. 

Resizing doesn't do anything: it already shows the max size for that partition. 

Is there a way to resize the ext4 fs, without actually formatting?  I ask because similar to NTFS, you can have a partition of say 100 GB for an NTFS format of only 32GB - you can then expand or shrink accordingly within that partition of 100GB.

Offline

#6 2015-05-24 04:32:54

Aerial Boundaries
Member
Registered: 2015-05-15
Posts: 26

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

I think you can use fdisk to resize the partition, followed by resize2fs for the filesystem. But please google it or wait for someone more experienced, I don't want you to f anything up because of me haha

Offline

#7 2015-05-24 04:38:23

eduncan911
Member
Registered: 2015-05-02
Posts: 93
Website

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

Aerial Boundaries wrote:

I think you can use fdisk to resize the partition, followed by resize2fs for the filesystem. But please google it or wait for someone more experienced, I don't want you to f anything up because of me haha

That's the advantage of VMware.

[click] Snapshot -> New

>>>> Frack it all up <<<<

[click[ Snapshot -> Restore


Yeah, was just reading that fdisk can handle deleting the entry in the partition table without fluxing the data.

http://unix.stackexchange.com/a/67107/87206

But isn't fdisk only for MBR disks?  This is an EFI formatted disk.

Offline

#8 2015-05-24 04:42:27

Aerial Boundaries
Member
Registered: 2015-05-15
Posts: 26

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

There is a version for that I believe

https://www.archlinux.org/packages/extra/i686/gptfdisk/

Offline

#9 2015-05-24 04:48:37

eduncan911
Member
Registered: 2015-05-02
Posts: 93
Website

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

resize2fs was it!

(booting from Arch live iso)  (appologies for type-os, I have no copy-n-paste from live iso)

# resize2fs /dev/sda2
resize2fs 1.42.12 (29-Aug-2014)
Please run 'e2fsck -f /dev/sda2' first.

# e2fsck -f /dev/sda2
Pass 1: Checking inodes, blocks and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 334025/1605632 files (0.1% non-contiguous), 3070781/6422272 blocks

# resize2fs /dev/sda2
Resizing the filesystem on /dev/sda2 to 31063808 (4k) blocks.
The filesystem on /dev/sda2 is now 31063808 (4k) blocks long.

Rebooted and...

$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       117G   12G  100G  11% /

Success!  So basically I created a partition of 120GB, for formatted only 25GB of it.  Long story, I was using multiple 25GB partitions for /, /home, /var, etc.  Decided to rebuilt the system with just a single partition.  Must have forgotten to use all of the diskspace, instead of settting it to 25GB.

Thank you!  if there was a "Thanks" button, you'd get it.  smile

And welcome to Arch!

Last edited by eduncan911 (2015-05-24 04:52:18)

Offline

#10 2015-05-24 05:08:25

Aerial Boundaries
Member
Registered: 2015-05-15
Posts: 26

Re: [RESOLVED] Partition: Unallocated Space, can't resize to use it

Nice one, no problem.

Thanks smile

Offline

Board footer

Powered by FluxBB