-1

I had windows & Kali linux (dual boot) then I took off Kali linux Parition so I delete it but I Made a mistake ... and PC won't boot "Rescue grub error" or something ...

but I installed Ubuntu & removed Windows and all . All is running fine but I just can't open one of my disks , this is the error :

Error mounting /dev/sdb5 at /media/imad/Disque local: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb5" "/media/imad/Disque local"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sdb5': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.

I asked this question before but no one had an idea , help please .

user3091970
  • 113
  • 1
  • 6
  • That's a windows filesystem. There is a reason I won't mount a NTFS filesystem with Linux. Assuming that it's a USB drive, try running a CHKDSK on it from a Windows machine. – Elliott Frisch Apr 22 '14 at 20:25
  • 2
    To safely repair a windows formatted drive with Linux? I don't think so. You could try running fsck.ntfs but it may well eat any and all data you still have on the drive. – Elliott Frisch Apr 22 '14 at 20:28
  • not sure what fsck.ntfs means :x any guide please – user3091970 Apr 22 '14 at 20:30
  • Here you go. I re-iterate, it might destroy your data. – Elliott Frisch Apr 22 '14 at 20:31
  • @ElliottFrisch the solution you recommend worked fine for me with no data loss. – Cornelius Apr 22 '14 at 20:48
  • If there is no important data on your NTFS partition, it would be better to repartition your entire hard disk. You can use Gparted tool from Ubuntu Live DVD to wipe out the entire disk, and after that you can use your Win7 DVD to install Windows inside a first primary partition, and next you can use the same Ubuntu DVD to partition the rest of the disk (creating an extended partition with more logical drives both NTFS and Linux).This way you can have 1-2 primary partitions and as many logical drives as you want. But do leave around 15-20 MB unallocated space at the end of your partition table. – Taz D. Apr 22 '14 at 21:17
  • I agree with @floppy, but since your recovery worked; copy the data somewhere first! – Elliott Frisch Apr 22 '14 at 23:00

2 Answers2

0

The most likely explanation is that you had hibernated your Windows install instead of shutting it down. The normal solution is to simply boot into Windows and then shut it down cleanly but since you have uninstalled Windows, that's not an option.

So, your other choice is (from man ntfs-3g):

   remove_hiberfile
          Unlike  in  case  of  read-only  mount,  the read-write mount is
          denied if the NTFS volume is hibernated.  One  needs  either  to
          resume  Windows  and  shutdown  it  properly, or use this option
          which will remove the Windows  hibernation  file.  Please  note,
          this  means  that  the  saved Windows session will be completely
          lost. Use this option under your own responsibility.

So, just add the remove_hiberfile option and try to mount it again:

sudo mount -t "ntfs" -o remove_hiberfile /dev/sdb5 "/media/imad/Disque local"

or

sudo ntfs-3g -o remove_hiberfile /dev/sdb5 "/media/imad/Disque local"

That should mount the drive correctly and since it will delete the hibernated session file, it should mount normally from now on.

terdon
  • 100,812
  • both commands give me this error : The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sdb5': Opération non permise The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. – user3091970 Apr 21 '14 at 12:11
  • @user3091970 that's strange, this is precisely why that option exists. You don't have a Windows system installed anymore right? I assume you have important data on that partition, is that true or can you format it? – terdon Apr 21 '14 at 12:21
  • Yes , it's very important data :( and no Windows is not installed anymore . – user3091970 Apr 21 '14 at 12:22
  • @user3091970 I really don't know why this is not working. One thing you could do is to create an image file of the partition and then mount that: sudo mount -t ntfs -o loop sda5.img ~/tmpdir. You can then copy your data over, format the partition and copy the data back. – terdon Apr 21 '14 at 12:27
0

Your question is why you cannot mount the file system. The reason is that it wasn't properly unmounted. This usually happens if you don't shut down Windows the correct way, don't use "Safe removal" before you disconnect the disk, or you're using Windows 8, which doesn't shutdown properly (by design) unless you deactivate "Fastboot".

It's a very common issue with Windows systems.

  • now if I re-formate and remove all Ubuntu & put Windows 8.1 again , will I Get any issues ? – user3091970 Apr 24 '14 at 16:05
  • In general, we usually recommend installing Windows first, because Ubuntu can understand Windows, but not vice versa. If you install Ubuntu first and Windows later, then you'll have to fix your boot loader manually. If you do the opposite, the Ubuntu installer will do it automatically. Yes, the Windows Filesystem issue is not related to Ubuntu. It always happens if you don't shutdown Windows properly or disconnects a disk without using "Save removal" first. – Jo-Erlend Schinstad Apr 26 '14 at 06:38