You are not logged in.

#1 2022-06-25 03:29:57

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

[Solved]Screwed up partition size

I was trying to expand efi boot partition and i made some free space(which i haven't touch) by resizing the main(root) partition without changing the file system, now i get an error wich says the blocks don't match. What can i do to fix this? I hace access to windows in the same disk if this may help in any way

Last edited by Dioswilson (2022-06-30 03:59:29)

Offline

#2 2022-06-25 06:31:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

If you *just* edited the partition table (eg. w/ fdisk), simply undo that edit.
If you've already expanded the FS of the efi partition, formated it, …: Pray.

Afterwards, shrinking a FS rightwards is not trivial since it requires to move the FS head what's equivalent to moving the entire partition.
People trash their data doing this all the time so make sure to have backups.

Offline

#3 2022-06-25 14:36:05

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

If you *just* edited the partition table (eg. w/ fdisk), simply undo that edit.
If you've already expanded the FS of the efi partition, formated it, …: Pray.

Afterwards, shrinking a FS rightwards is not trivial since it requires to move the FS head what's equivalent to moving the entire partition.
People trash their data doing this all the time so make sure to have backups.

I can't use many commands in the terminal, can't use fdisk. It says i should run fsck manually, but don't know what to do either

Last edited by Dioswilson (2022-06-25 14:37:29)

Offline

#4 2022-06-25 15:01:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

You'll have to fix that offline, eg. using https://grml.org/

Offline

#5 2022-06-25 15:01:45

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: [Solved]Screwed up partition size

Dioswilson wrote:

It says i should run fsck manually, but don't know what to do either

You should at least read wiki/s & man page/s
Be sure to make backups!
You can start here https://wiki.archlinux.org/title/Fsck
Good-luck;)

Offline

#6 2022-06-25 15:16:22

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

You'll have to fix that offline, eg. using https://grml.org/

Could i do this from the windows partition?tried with EaseUs, but it could't resize the ext4 partitions

Offline

#7 2022-06-25 15:22:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

I'd stay away from more fancy/elaborate/integrated partition tools because it's hard to say what they do and you want to ***ONLY*** rewrite the partition table and under no circumstances write to any of the involved partitions.
You especially do NOT want to run fsck anywhere!

Edit: grml is a live distro with a bunch of system diagnosis/recovery tools - you can boot and run it from a usb key.
Edit #2: "more fancy/elaborate/integrated partition tools" includes the MS tool on windows!

Last edited by seth (2022-06-25 15:23:38)

Offline

#8 2022-06-25 15:28:34

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: [Solved]Screwed up partition size

seth wrote:

You especially do NOT want to run fsck anywhere!

If in this case it harmful forget what I said, but please elaborate?

Offline

#9 2022-06-25 15:29:33

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

You especially do NOT want to run fsck anywhere!

I already run it when i rebooted and it said which i should and it aparently did nothing because of the error.What could have gone wrong?

Offline

#10 2022-06-25 15:39:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

qinohe wrote:
seth wrote:

You especially do NOT want to run fsck anywhere!

If in this case it harmful forget what I said, but please elaborate?

Well, just testing doesn't really do anything - problems start when you allow it to (auto)fix stuff.
The OP has edited the partition table under an existing FS, so the present root partition isn't aligned w/ any filesystem.
The solution is to return to the original partition table, correctly moveshrink the filesystem (that's gonna be a dangerous PITA in and by itself - we'll handle that once he's back to the status quo ante), then alter the partition table.
*ANY* efforts to write onto the bogus partition are gonna harm the original filesystem and likely (esp. on the beginning of the partition) result in data loss.

Offline

#11 2022-06-25 16:04:50

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: [Solved]Screwed up partition size

seth wrote:

*ANY* efforts to write onto the bogus partition are gonna harm the original filesystem and likely (esp. on the beginning of the partition) result in data loss.

Oh my I really didn't know that:(, thanks for explaining though.

Dioswilson wrote:

...aparently did nothing because of the error.

I hope the action had no damage done, very sorry!

Offline

#12 2022-06-25 16:10:31

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

You'll have to fix that offline, eg. using https://grml.org/

Just to be sure. I should reexpand the root partition with this program? Also if i want to expand the boot partition(which is before root partition) what should i do?

Offline

#13 2022-06-25 16:24:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

I should reexpand the root partition with this program?

Yes. You want to restore the paritition table that was there before. If you didn't write into that area of the disk, you filesystem and all files will still be there and immediately return.
If you cannot reconstruct the original partition table (because you forgot the sizes), testdisk can also find them for you, https://wiki.archlinux.org/title/File_r … d_PhotoRec (you do not want to use it for anything else)

Also if i want to expand the boot partition(which is before root partition) what should i do?

For the partition that's in the way of growing the EFI, you'll first have to shrink the filesystem, then the partition at the end, then move it, https://wiki.archlinux.org/title/Fdisk# … partitions

Offline

#14 2022-06-25 16:29:49

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

If you didn't write into that area of the disk, you filesystem and all files will still be there and immediately return.

The empty area?

Offline

#15 2022-06-25 19:44:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Re: [Solved]Screwed up partition size

The empty area or the bogus partition, yes.
If you wrote there, you've damaged the underlying data and even if you restore the partition and this way align the FS, it'll be corrupted.

Offline

#16 2022-06-25 20:52:44

Dioswilson
Member
Registered: 2022-06-24
Posts: 24

Re: [Solved]Screwed up partition size

seth wrote:

If you wrote there, you've damaged the underlying data and even if you restore the partition and this way align the FS, it'll be corrupted.

Thanks for all your help! I will try this, I hope it works.
Do you know where could i get infomation about disks partitions, file system etc? I'd like to know about this
Edit: How do i use this grml program? Can't find a tutorial about it. Is there any other similar tool which is easier to use/have a good tutorial?

Last edited by Dioswilson (2022-06-25 21:06:23)

Offline

#17 2022-06-25 21:00:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,569

Offline

Board footer

Powered by FluxBB