You are not logged in.
In an attempt to shrink my /home partition, I can no longer boot into my desktop.
I used the resizepart command in parted to shrink /dev/sda3 to 1920GB instead of 2000GB, rebooted and couldn't boot. I then changed it back to 2000GB which didn't fix it.
The answer to this unix stackexchange question seems to be relevant to the problem I'm facing but the way it's phrased confuses me.
https://unix.stackexchange.com/question … ystem-arch
One possible solution is to grow your partition back to its original size, but I'm not talking in GiB size, it must be exactly the size in blocks for e2fsck to actually work, so this should be no problem if the rest of the partition is still there unaltered, just grow it to the max again.
Did I not grow it to max again? Obviously I'm doing something wrong, I would like to hear what other people think.
Last edited by Firebert (2024-01-19 20:49:40)
Offline
Did you run fsck on the partition after resizing it back to maximum? The posted link does explain that you might have lost important data, if that is the case you will have to restore /home/ from your backup. You do have a backup, right?
Jin, Jîyan, Azadî
Offline
The "exact" part is important, you need to be absolutely sure you used the exact same units (e.g. not GB now and GiB when you originally did it or vice versa) and that landed on the exact same sector again.
And for prosterity, if you shrink you need to shrink the filesystem first, then the partition, if you grow you need to grow partition size, then the filesystem. As we've seen here this can go sideways quickly (add to the fact that parted used to do both steps, but that got removed (... too much complexity?) at some point a few years ago), so if you're doing this from your terminal you need to be absolutely certain to do things in that order. Since this is prone to get fumbled even if one is careful, I'd strongly suggest you keep a gparted live disk handy and use gparted to do these things.
Last edited by V1del (2024-01-19 09:15:10)
Online
The "exact" part is important, you need to be absolutely sure you used the exact same units (e.g. not GB now and GiB when you originally did it or vice versa) and that landed on the exact same sector again.
I remember distinctly that KDE told me /dev/sda3 was 1.9TiB, which would be larger than what parted is telling me is the size of the device.
When I try to run fsck it tells me that the filesystem size is 483004160 blocks, would this be the exact number? When I try to resize it it says it's outside of the device, which is 2000GB.
The posted link does explain that you might have lost important data, if that is the case you will have to restore /home/ from your backup. You do have a backup, right?
I do not. Is it possible to wipe /home and boot again while retaining the root partition, or should I just reinstall at that point?
Offline
That is a better/more acciurate number yeah (... that you would need to add from the partition startpoint up to the end). Not entirely sure whether there's some additional stuff after for the partition end point but this will definitely be more exact.
Wiping home is never a problem (... for the system) but if you have valuable user data there that would potentially be lost.
Last edited by V1del (2024-01-19 14:42:52)
Online
That is a better/more acciurate number yeah (... that you would need to add from the partition startpoint up to the end).
I multiplied 483004160 by 4096 (bytes/block), added it to the start of the partition and got 2000397795328B. Parted says this is outside of the device, could the size of the device have changed somehow?
Wiping home is never a problem (... for the system) but if you have valuable user data there that would potentially be lost.
I assume just removing the parition and creating a new one will still cause it to get confused and not boot, is there a wikipage/guide for doing this?
Offline
If you add a new partition and format it the filesystem UUID will change so you will have to edit /etc/fstab to reflect that if you're using UUIDs there.
Jin, Jîyan, Azadî
Offline