File System check: which partition, -y flag?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
coyote2
Level 3
Level 3
Posts: 138
Joined: Sat Jan 25, 2020 3:51 pm

File System check: which partition, -y flag?

Post by coyote2 »

I think I want to run a file system check on my one Linux (IIRC, EXT4) partition, my Linux Mint Mint 19.2 Xfce system partition.

(I think I want to do this because I'm trying to troubleshoot why my system drive backups with Clonezilla boot media have been failing for weeks. I already discovered the drives pass physical diagnostics with HD Tune, the RAM is error-free per Memtest86, and the NTFS filesystems are AOK per CHKDSK.)

I read https://www.tecmint.com/fsck-repair-fil ... -in-linux/
I'm thinking that I'll boot to a Mint 19.2 thumbdrive to avoid the issue of needing the partition to be unmounted.

But I have a couple questions.

I see that the command will be

Code: Select all

# fsck /dev/sdbN
But as a noob I don't know how to determine which N partition is my system partition.

Would I be unwise to use the

Code: Select all

-y
flag?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: File System check: which partition, -y flag?

Post by rene »

You need the /dev/sdXY that is in the output of df now shown mounted on /.

It's by the way slightly better to do this from the so-called initramfs than from the live system: quicker and even theoretical certainty of the /dev/sdX part being the same between a normal boot and the initramfs one. To boot into the initramfs you add break as a kernel command line parameter. Easiest by booting into the Grub menu, editing the kernel command line ("e" I believe it was: displayed on screen), adding that break to the end of the linux line after e.g. quiet splash and hitting F10 to boot. From the (initramfs) prompt you say

Code: Select all

fsck -fy /dev/sdXY
and use exit to continue the normal boot when it's done. You need the -f flag to force an actual fsck even if the filesystem was marked clean.

But Live-system will also work and same -f thing applies.

No, -y would not be unwise. If any trouble is found you are not (no one is, really) going to know when to say no to a suggested repair anyway.
Last edited by rene on Fri May 07, 2021 2:14 pm, edited 1 time in total.
User avatar
spamegg
Level 14
Level 14
Posts: 5089
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: File System check: which partition, -y flag?

Post by spamegg »

You can use lsblk or sudo parted --list
Locked

Return to “Beginner Questions”