Score:2

“Please run ‘e2fsck -f /dev/nvme0n1p7’ first” when trying to resize partition using GParted

cn flag

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?

jpbrain avatar
ca flag
Hi. Not sure it will help but Keep in mind that you cannot fsck on a mounted drive. Are you doing it on an unmounted drive?
Vachnika avatar
cn flag
Yes, the drive is unmounted.
oldfred avatar
cn flag
e2fsck only works on the extX family of formats. And chkdsk only works on Windows formats. What format is partition?
Vachnika avatar
cn flag
ext4. I gave up and came back the next morning and it worked, no restart or anything. I love computers.
Score:3
mv flag

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.

Sam avatar
ao flag
Sam
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.
capohugo avatar
az flag
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
Score:0
fr flag
RPX

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.