this post was submitted on 19 Jul 2024
16 points (90.0% liked)
Linux
5237 readers
225 users here now
A community for everything relating to the linux operating system
Also check out !linux_memes@programming.dev
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Sure.
This depends on the name of your block devices, but you'd probably want to do this in two runs: a test run, and then a real run to fix the problems.
You probably can determine the drive name via
lsblk -o NAME,MODEL
command. You're probably looking for a sda/sdb/sdc device, though NVME drives may be named something else. Using -o NAME,MODEL gives you a column with the name and the device model which should make identifying what you're after simpler. Probably there's only going to be two devices listed, though: the USB stick and your SSD.You also want to identify the exact partition, ex. sda1, since that's what FSCK will want. You're probably going to need to do all the partitions on the drive.
To fsck I like doing a dry run to see what happens since sometimes it's going to do things that are.... not strictly ideal: (replace /dev/device with the actual device name and partition, ex. /dev/sda1)
fsck -N /dev/device
Assuming there's nothing catastrophic that shows up, then
fsck -y /dev/device
to actually run the fsck on the filesystem.
Couple of warnings: this COULD explode the data on your drive depending on what's broken, so if there's something you MUST have a copy of, try to get it first. Again, to be 100% clear: depending what's wrong you could lose every last byte of data on that drive.