What is the Chk Dsk (Windows)Command Equivalent in ubuntu

Asked by mynameismethos

I Just wanted to know Which Command in Linux Checks Removable Media hard drives Etc like the check disk command in Dos to Check for example a mp3 Storage if the device is not Performing well due to memory corruption or fragmentation on the hard drive.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ed S
Solved:
Last query:
Last reply:
Revision history for this message
Ian Ace (iaculallad) said :
#1

Terminal equivalent would be fsck

Revision history for this message
mynameismethos (jzamudio97) said :
#2

Hi :) So i put fsck and the name of the media i wanna check

Revision history for this message
Best Ed S (edgar-b-dsouza) said :
#3

The fsck command checks filesystems (it has different variations like fsck.ext2, fsck.ext3, fsck.ext4, fsck.vfat (for FAT filesystems, which would be most USB drives and memory cards).

I don't know what you mean by an "MP3 storage" but if you wanted to check the filesystem on a USB drive, you would (run the commands in a terminal window):
1. Plug in the drive to the computer.

2. Run: sudo fdisk -l
This helps you identify which device is your USB drive, based on its size, usually. On most computers, this will be /dev/sdb.

3. Run: mount
Look for lines with the device name from step 2. For example:
/dev/sdb1 on /media/C80B-46F1 type vfat
Note the partition device name (e.g. /dev/sdb1) and the filesystem type (in this case, vfat).

4. For each DEVICENAME found in Step 3, run:
sudo umount DEVICENAME

5. For each DEVICENAME found in Step 3, run:
sudo fsck.TYPE DEVICENAME
For example:
sudo fsck.vfat /dev/sdb1

Here, TYPE is the filesystem type from Step 3.

Hope this helps...

Revision history for this message
Ian Ace (iaculallad) said :
#4

You can execute it with:

i.e: fsck.ext3 -f /dev/un_mounted_drive

Be very sure to unmount the drive first before running fsck.

HTH

Revision history for this message
mynameismethos (jzamudio97) said :
#5

Thank you this solved my problem

Revision history for this message
mynameismethos (jzamudio97) said :
#6

Thanks Ed S, that solved my question.

Revision history for this message
Ed S (edgar-b-dsouza) said :
#7

Glad to be able to share! :-) Thanks for marking the question as solved, and my answer as the solution...

Regards,
Ed.