- How can I run fsck on ntfs partitions on my hard drive? [duplicate]
- fsck an ntfs drive in Linux
- @Update — vm solution
- Как исправить поврежденную файловую систему Windows NTFS с помощью Ubuntu
- Установите и загрузите Ubuntu
- Исправление поврежденного раздела Windows NTFS
- Fix corrupt NTFS partition without Windows
How can I run fsck on ntfs partitions on my hard drive? [duplicate]
A few years ago I switched from Windows to Ubuntu 14.04 LTS for my desktop PC. I installed the Ubuntu operating system (root+home+swap) in the space previously assigned to the C partition, while the other partitions (D,E,F and G) were left undisturbed. Thus the partitions containing the new operating system now have the ext4 file system while the other partitions continue with ntfs. This has been serving my purpose well enough. Recently, however, for the first time I made several attempts to run fsck on the ntfs partitions of the hard drive, and I received the following message:
fsck from util-linux 2.20.1 fsck: fsck.ntfs: not found fsck: error 2 while executing fsck.ntfs for /dev/sda5
When I try to run fsck on my external hard drive, which also has ntfs, the message that is returned is:
fsck from util-linux 2.20.1 e2fsck 1.42.9 (4-Feb-2014) ext2fs_open2: Bad magic number in super-block fsck.ext2: Superblock invalid, trying backup blocks. fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 or e2fsck -b 32768
Can anybody please throw any light on what is happening and how I can run fsck on ntfs partitions and devices?
fsck an ntfs drive in Linux
Yes. This was handled by fsck on some releases. If the partition is not listed in /etc/fstab , then you will likely need to tell it the partition type. I’ve used this from a Linux CD to recover a partition Windows wouldn’t boot from.
Based on the comments below, the actual fixing is done by the ntfsfix program. It should be available, even if there is no program to run a fsck on an NTFS file system.
Although as noted in the man page for ntfsfix/fsck.ntfs, it is not a Linux version of chkdsk and only checks for certain kinds of obvious problems on the disk.
I assume from the above comment that fsck.ntfs was at some point handled by ntfsfix . Comments on a lower post indicate this may not be workable now as their arguments are not compatible. Anyway, in Debian 8.2, fsck.ntfs does not exist — but ntfsfix does and was able to fix a corrupted MFT I encountered. Thanks @SabreWolfy for the hint.
Unfortunately the ntfsfix tool is very limited compared to Microsoft’s chkdsk. Try to get a Windows install going — preferably with the newest version of Windows as Microsoft is presumably constantly improving chkdsk (I hope..) New versions of Windows are often available for free as trials. If the problem is in a USB disk you can try installing Windows in something like VirtualBox and give the VM control of the USB device.
Or use Ultimate Boot CD for Windows. It’s a live Windows XP CD with lots of recovery tools. That’s how I solved my problem (corrupted NTFS partition). I tried using the ntfsck program included in the Parted Magic live USB, but I got an error saying Boot sector: bad NTFS magic. Segmentation fault .
maybe limited for some people, but it fixed my corrupted MFT just fine 🙂 [until the next time, perhaps! i’m not sure about this drive. ]
Hyper-V Server is a completely free (beer) but heavily cut-down version of Windows that’s designed for running VMs. The installer should contain all the usual utilities like chkdsk / diskpart , etc.
Take care using Windows ‘chkdsk /f’ on an NTFS used by Linux. I just followed this advice to fix errors on my external 2TB backup drive. It deleted the names of 268 files and directories (incl. all my incr. backups) due to invalid characters (from NTFS viewpoint — most often ‘:’ used in timestamps). I reverted it all using the log file, but it took half a day of coding. Some but not all Linux system-calls block writing such invalid names on an NTFS. I use rsync for backups, which silently copies such invalid filenames — normally useful, until you need to fix other problems on the disk.
In my case, none of fsck & ntfsfix could fix the issue of my external NTFS mobile disk.
I end up to boot into windows os, and use follow steps to fix the disk issue.
- Check the identifier of the bad disk. e.g g
- Open the «cmd» terminal of windows.
- Input chkdsk : /f to fix it.
Where is the identifier, e.g chkdsk d: /f - Then it would be fixed within seconds (For a disk of size 1Tb).
After years, finally I found something that windows can do easily, but linux can’t 😉
@Update — vm solution
You can also create a windows vm (e.g win 7), then mount the mobile disk to windows vm, then you can also use chkdsk to fix the disk, it’s similar as boot into a windows machine.
I’d recommend using flag /x (unmount) for enforcing preventing access to the drive. Help manual says using /x implies also /f , so it helps for doing fixes the same way Linux does ( fsck requires drives being unmounted).
fsck /dev/sdg1 fsck from util-linux 2.21.2 Mounting volume. OK Processing of $MFT and $MFTMirr completed successfully. Checking the alternate boot sector. FIXED NTFS volume version is 3.1. NTFS partition /dev/sdg1 was processed successfully.
On fedora 22, there is another binary :
lrwxrwxrwx. 1 root root 13 May 22 22:13 /usr/sbin/fsck.ntfs -> ../bin/ntfsck
If you have NTFSProgs installed, you should be able to run fsck.ntfs or fsck -t ntfs to fsck an NTFS drive.
Running Debian 6.0.3, just installed ntfsprogs, no fsck.ntfs installed, and when running fsck with -t ntfs, get «fsck.ntfs not found». So don’t think the two are related.
@ZayneSHalsall In Debian, it happens to be a symlink to ntfsfix which is in ntfsprogs . I guarantee you that you will be able to run ntfsfix if ntfsprogs installed properly.
Newer versions of Debian and Ubuntu don’t have this symlink. You can make it yourself, but the problem is that ntfsfix has a completely different set of arguments to the standard fsck ones. It’s better to make fsck.ntfs (and fsck.ntfs-3 ) a script containing exec ntfsfix $ (with a shebang of #!/bin/bash ).@:$#>
@squircle thank you man sudo ntfsfix /dev/sda1 fixed my issue. fsck.ntfs -f /dev/sda1 and fsck -t ntfs -f /dev/sda1 exited early with fsck from util-linux 2.31.1
Using a fsck.ntfs solved my similar problem in a Windows ntfs partition + Ubuntu 20.XX LTS partition (can’t remember exact version):
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda ├─sda1 ├─sda2 vfat FAT32 1950-4B8D 505,9M 1% /boot/efi └─sda3 ext4 1.0 29ee8e5b-457e-4610-a503-c8142cc40d68 sdb └─sdb1 ntfs HDD 42AEC908AEC8F607 sdc ├─sdc1 ntfs Recuperação 04C0478BC0478242 └─sdc2 ext4 1.0 8be461e1-7470-45f6-844c-7559ed2769e9 380,6G 8% /
As you can see, I need to fix my HDD labeled driver (42AEC908AEC8F607), so ln -s /bin/ntfsfix /sbin/fsck.ntfs and after an fsck /dev/sdb1 solved for me, even loggin windows ‘refuse to mount’ FAILED:
root@bruno-andrade:/home/bruno# fsck /dev/sdb1 fsck from util-linux 2.37.2 Mounting volume. The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. FAILED Attempting to correct errors. Processing $MFT and $MFTMirr. Reading $MFT. OK Reading $MFTMirr. OK Comparing $MFTMirr to $MFT. OK Processing of $MFT and $MFTMirr completed successfully. Setting required flags on partition. OK Going to empty the journal ($LogFile). OK Checking the alternate boot sector. FIXED NTFS volume version is 3.1. NTFS partition /dev/sdb1 was processed successfully.
Thanks to @tanguy in his answer: fsck an ntfs drive in Linux
Как исправить поврежденную файловую систему Windows NTFS с помощью Ubuntu
Если вы не можете загрузить свою Windows или у вас возникли проблемы с подключением раздела NTFS Windows, Ubuntu всегда готов все исправить.
У скольких из вас было такое чувство, что ваш компьютер не загружается? Вы чувствуете, небольшое беспокойство в глубине вашего сознания, которое говорит: «Это занимает больше времени, чем обычно», прежде чем Windows упадет замертво перед вами и покажет синий экран.
Когда дело доходит до исправления вашей сломанной Windows, Ubuntu тоже может помочь. Если вам случится повредить вашу файловую систему или главную загрузочную запись в Windows, не бойтесь, не все потеряно. Вы можете использовать Ubuntu для устранения проблем, связанных с операционной системой Windows. Этот метод должен работать с любым дистрибутивом Linux на базе Ubuntu.
Установите и загрузите Ubuntu
Те из вас, у кого уже есть компьютер с Ubuntu и Windows с двойной загрузкой, могут пропустить этот шаг.
Если у вас нет USB-накопителя, вам нужно его достать. Но сначала вам нужно загрузить официальный установочный ISO-файл Ubuntu.
После этого пришло время создать новый загрузочный Ubuntu USB. Существует несколько инструментов для создания загрузочного USB-файла из файла ISO, но вы можете использовать balenaEtcher , поскольку он поставляется с простым в использовании интуитивно понятным интерфейсом. Все, что вам нужно сделать, это выбрать файл ISO и мультимедийное устройство и нажать Flash .
Если вы используете двойную загрузку, то это простой шаг выбора Ubuntu вместо Windows при загрузке. Для live USB -накопителей и компакт-дисков вам нужно будет войти в настройки BIOS при загрузке компьютера (обычно нажатием F2 или Del ) и настроить загрузочные устройства так, чтобы ваше USB-устройство или дисковод компакт-дисков загружались приоритетнее основного жесткого диска.
Если вы все сделали правильно, появится загрузчик Ubuntu. Отсюда вы загрузитесь непосредственно в действующую операционную систему, выбрав Ubuntu . Через минуту или две вы увидите, как появится рабочий стол, и можно начать.
Исправление поврежденного раздела Windows NTFS
Вы можете запланировать проверку NTFS, чтобы попытаться восстановить поврежденный раздел Windows NTFS из Ubuntu, но сначала вам нужно будет установить некоторые пакеты. Стоит отметить, что это должно работать с любым диском NTFS, который также отказывается монтироваться в Ubuntu.
Откройте терминал и установите NTFS-3G, введя эту команду:
Fix corrupt NTFS partition without Windows
MY NTFS Partition has gotten corrupt somehow (it’s a relic from the days when I had Windows installed). I’m putting the debug output of fdisk and blkid here. At the same time, any OS is unable to mount my root partition, which is located next to my NTFS partition. I’m not sure if this has anything to do with it, though. I get the following error while trying to mount my root partition (sda5)
mount: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so ubuntu@ubuntu:~$ dmesg | tail [ 1019.726530] Descriptor sense data with sense descriptors (in hex): [ 1019.726533] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 1019.726551] 1a 3e ed 92 [ 1019.726558] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed [ 1019.726568] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 1a 3e ed 40 00 01 00 00 [ 1019.726584] end_request: I/O error, dev sda, sector 440331666 [ 1019.726602] JBD: Failed to read block at offset 462 [ 1019.726609] ata1: EH complete [ 1019.726612] JBD: recovery failed [ 1019.726617] EXT4-fs (sda5): error loading journal
When I open gparted (using live CD), I get an exclamation next to my NTFS drive which states Is there a way to run chkdsk without using windows ? My attempt to run fsck results in the following :
ubuntu@ubuntu:~$ sudo fsck /dev/sda fsck from util-linux-ng 2.17.2 e2fsck 1.41.14 (22-Dec-2010) fsck.ext2: Superblock invalid, trying backup blocks. fsck.ext2: Bad magic number in super-block while trying to open /dev/sda The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193
Update: I was able to fix the NTFS partition running chkdsk off Hiren’s BootCD, but it seems that the superblock problem still remains. Update 2: Fixed superblock issue using e2fsck -c /dev/sda5