You are not logged in.

#1 2025-10-13 19:42:59

chris_sugden
Member
Registered: 2018-02-23
Posts: 9

[SOLVED] Bad Geometry After Mucking With Partitions

"pacman -Syu" failed with a warning there was not enough room on my drive.

My lsblk for that drive was:
sda
--sda1   512mb boot
--sda2 40.8GB   root
--sda3   4GB       swap
--sda4 (the rest of that 1TB drive) home

I hope the rest of my tale explains me saying "(the rest of that 1TB drive)".

I booted from a USB and used parted.

    Removed the swap partition

    Resized the root partition to take that space

    Resized the home partition to allow re-creating a 40GB swap partition from the hundreds of GB available on sda4 (home)

Realizing I can get by without a swap partition, I resized sda4 (home) back to what I thought it was using these parted command:

   resizepart 4 1000GB

Hoping I hadn't lost all my data, I created /mnt/root and /mnt/home

sda2 mounts but sda4 throws this message in dmesg:

EXT4-fs (sda4): bad geometry: block count 233376433 exceeds size of device (233326417 blocks)

It's late in the game to think of it, but I have some old 1TB hard drives to which I could backup sda4, but how since it won't mount.

And how do I get the sizes of my partitions to be the same in lsblk (40.8/890.1) as it does in parted (43.8/956)?

I assume getting the sizes to match will solve my mounting error.

Last edited by chris_sugden (Yesterday 19:29:24)

Offline

#2 2025-10-13 19:58:59

frostschutz
Member
Registered: 2013-11-15
Posts: 1,573

Re: [SOLVED] Bad Geometry After Mucking With Partitions

There seem to be only a few sectors missing. If `parted /dev/disk unit s print free` shows some free space still available, just resizepart again to include it.

If those sectors are not available... did you convert from MBR to GPT? GPT eats a few sectors at the end of disk for GPT header backup.

In that case you could try your luck with losetup --find --show --offset (start offset of the partition in bytes, in parted use `unit b`, `print`). Then resize2fs to make it smaller.

But that modifies the filesystem; it would be preferable to just grow the partition again.

Edit: Oh I misread the number, not just off by a few sectors. Answer remains the same regardless.

Last edited by frostschutz (2025-10-13 20:03:39)

Offline

#3 2025-10-13 20:24:02

chris_sugden
Member
Registered: 2018-02-23
Posts: 9

Re: [SOLVED] Bad Geometry After Mucking With Partitions

Thanks, frostschutz.

I have UUIDs in the fstab for this, it is a UEFI machine and recall choosing GPT.

In parted, it is as you say.  Using unit s partition 4 shows 400,134s as Free Space.

Since I believe this is your suggestion - and it makes sense - I will issue this command in parted:

resizepart 4 1953525134s (sector showing as END of the Free Space in the print from parted)

Last edited by chris_sugden (2025-10-13 20:27:17)

Offline

#4 2025-10-13 21:00:12

chris_sugden
Member
Registered: 2018-02-23
Posts: 9

Re: [SOLVED] Bad Geometry After Mucking With Partitions

Thanks, again, frostschutz.

Issuing that command has put my partitions to rights, and I have booted normally.

I'm running without a Swap Drive, but time will tell if that is a problem.

I still don't understand why there is a difference between the partition sizes showing in lsblk vs parted:

LSBLK:
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0   512M  0 part /boot
├─sda2   8:2    0  40.8G  0 part /
└─sda4   8:4    0 890.3G  0 part /home

PARTED:
Number  Start   End     Size    File system  Name         Flags
1      1049kB  538MB   537MB   fat32                     boot, esp
2      538MB   44.3GB  43.8GB  ext4
4      44.3GB  1000GB  956GB   ext4         Linux /home  linux-home

Perhaps it's always been there and I never had need to look in parted before?

I'll try that pacman update which failed, now.

Offline

#5 2025-10-13 21:09:47

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,058

Re: [SOLVED] Bad Geometry After Mucking With Partitions

537*1000^2/1024^2
43.8*1000^3/1024^3
956*1000^3/1024^3

google SI and JEDEC

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

#6 2025-10-14 05:36:18

frostschutz
Member
Registered: 2013-11-15
Posts: 1,573

Re: [SOLVED] Bad Geometry After Mucking With Partitions

you can use 'unit gib' or 'unit mib' in parted to match lsblk. or 'unit b' and 'lsblk --bytes'

Offline

#7 2025-10-14 06:05:18

cryptearth
Member
Registered: 2024-02-03
Posts: 1,722

Re: [SOLVED] Bad Geometry After Mucking With Partitions

is there a reason you gave the os just 40gb from a 1tb drive?
mine is just 512gb and I still granted arch a full 100gb (although according to df I only use about 20gb right now - how much stuff have you installed in your os to exceed the 40gb you gave it? - you may want to give https://wiki.archlinux.org/title/System … filesystem a shot)

Offline

#8 Yesterday 19:42:59

chris_sugden
Member
Registered: 2018-02-23
Posts: 9

Re: [SOLVED] Bad Geometry After Mucking With Partitions

Thanks all

crypearth: pacman -Syu is still failing telling me that there is not enough room.

Packages are downloaded to ~/pkgcache on my sda4 partition, which has over 300gb available.

Moving all existing packages to another drive does not help the issue.

Since this thread is about my failure to claim the free space left when I mucked about in parted, I'll open another for the pacman fail issue and have marked this one [SOLVED]

THANKS ALL!!!

Last edited by chris_sugden (Yesterday 20:02:13)

Offline

#9 Yesterday 19:54:25

cryptearth
Member
Registered: 2024-02-03
Posts: 1,722

Re: [SOLVED] Bad Geometry After Mucking With Partitions

the main pacman cache should not be inside any users $home as this can cause permissions issues
you may should backup your data and start from a clean driv and grant arch more space as you have it

Offline

#10 Yesterday 20:04:40

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,058

Re: [SOLVED] Bad Geometry After Mucking With Partitions

Lengthy discussion, https://bbs.archlinux.org/viewtopic.php?id=299394 - tl;dr to maintain the location in your $HOME (questionable setup, but well) you can bind-mount the directory into a public path.
That being said: I use a tmpfs as package download cache…

Online

#11 Yesterday 20:34:15

chris_sugden
Member
Registered: 2018-02-23
Posts: 9

Re: [SOLVED] Bad Geometry After Mucking With Partitions

Since it seems Seth would be the one to ask me not to necro-post, I'll take the liberty.

Thanks, cryptearth and Seth.

I've looked at that topic, moved my pkgcache folder to /home and root now owns it.

pacman.conf also updated.

I've opened a new topic for my root partition size issue, and will check out the various "Disk usage display" applications suggested.

Offline

#12 Yesterday 20:47:11

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,058

Re: [SOLVED] Bad Geometry After Mucking With Partitions

The thread is only 2 days old - no risk of necromancy whatsoever wink

Online

Board footer

Powered by FluxBB