3

I’m running GParted from a live usb. When GParted tries to execute resize2fs -p /dev/nvme0n1p7 It throws an error and says “Please run ‘e2fsck -f /dev/nvme0n1p7’ first”.

I have tried running the above command in terminal and following it with resize2fs -p /dev/nvme0n1p7 but get the same error. I’ve also tried rebooting as well as running chkdsk /f on windows.

Not sure what else to try. Any ideas?

2 Answers2

6

It has to do with the timezone of your system. GParted live, for instance, boots with UTC timezone.

If you are in GMT+something timezone, then the last time the partition was mounted is in the future. Therefore, running e2fsck does not update the date that resize2fs is checking to insure that the partition was checked.

Setting a date in the future, or waiting for a day, will be sufficient to resolve this issue.

I had the same problem as you, and your update gave me the idea to try that.

Zanna
  • 70,465
CoRpO
  • 61
  • 3
  • 1
    You're exactly right. However Instead of resetting the date on your system, you could just mount and unmount the drive. That will reset the last mount time to whatever your current system time is. – Sam Jun 13 '22 at 03:58
  • this comment about mounting and unmounting is genius, worked for me. Here's a good guide of how to mount and unmount from CLI: https://askubuntu.com/questions/1029040/how-to-manually-mount-a-partition – capohugo Aug 10 '22 at 12:19
2

In my case any change in the RTC or system date and time changed nothing and I kept getting the same error over and over again.

The solution was to add the -f option to resize2fs, e.g.

resize2fs -fp /dev/sda1 100M

RPX
  • 21