Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sorry if this question is already solved.

I changed my Operating System, from Windows to Linux Ubuntu 13.04.

I have 2 partitions:

  • C: (system) and
  • M: It's NTFS; there I have my information, music, photos. When I want to access the Disk to use the information, I can't get past this error:

Error mounting /dev/sda2 at /media/love/Mis Archiivos: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda2" "/media/love/Mis Archiivos"' 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/sda2': 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.

Clarification: I don't have 2 OSes. I only have Linux installed.

share|improve this question
add comment

6 Answers

You could try this (worked for me with similar problem):

  1. sudo apt-get install ntfsprogs
  2. sudo ntfsfix /dev/sdb2

That worked for me. Good luck!

share|improve this answer
    
When I put this code in terminal, have a lot of errors :S Another idea? –  Federico Ribero May 4 '13 at 16:23
    
@FedericoRibero What kind of errors you got? May you paste them? :) EDIT: you could try use this command first: sudo apt-get install ntfs-3g –  shardival May 4 '13 at 16:28
    
Thank you! This worked fine. –  asattar Sep 3 '13 at 2:58
add comment

The problem is that the disk is marked as "unclean," meaning that it was not shut down properly and may contain errors. Unfortunately, there's no Linux utility to repair such problems on NTFS volumes. The ntfsfix utility recommended by shardival repairs only the most basic errors and then schedules a full repair by Windows the next time it's booted, so it's unlikely to help.

All this means that you must boot Windows to fix the problem. I realize you say you don't have Windows installed, so this means that you must either temporarily move the disk to a computer that does have Windows installed or use a Windows emergency repair disc. This site has such disc images, and I'm sure you can find them elsewhere, too.

In the long term, converting the NTFS partition to use a Linux filesystem is the best solution, but you can't do this until you repair the NTFS volume, or at least coax Linux into mounting it. Converting the partition to use a Linux filesystem will require backing up the files to another medium, unmounting the NTFS partition, creating a new Linux filesystem on the now-NTFS volume, re-mounting that partition, and copying the files back. I realize this is a hassle, but it will prevent a recurrence of the problem you've encountered, and give you better performance, too. (NTFS is slow on a Linux system compared to most Linux filesystems.)

share|improve this answer
add comment

I have another idea. This worked for me, when I corrupted somehow my external HDD with NTSF partition - and quite vital files inside.

  1. sudo apt-get install testdisk -y
  2. sudo testdisk
  3. Create log file (just in case)
  4. Then find your NTFS partition
  5. Advance
  6. Hit "undelete"
  7. Backup your files somewhere on your HDD.
  8. Format NTFS partition when you check all files are OK
  9. Profit!

This should help!

share|improve this answer
add comment

Answer:

If you can, boot into a Windows environment (this could even include WinPE¹) and run chkdsk /f in a command prompt². If you cannot boot into Windows, see this website on how to repair anything from a corrupt NTFS partition to a broken master boot record from Ubuntu. (scroll down to the part about a corrupt NTFS partition, of course)

Appendix:

  1. Windows Preinstallation Environment: This would be booting from a Windows Vista/7/8 install disc or WinPE created disc via alternate methods. (see resources) On a Windows Vista/7/8 disc, press SHIFT+F10 after it finishes booting to open a command prompt.

  2. chkdsk /f must be ran in a command prompt with elevated (administrator) privileges.

Resources:

  1. Legal (and free) Windows 7 ISO from Digital River (Microsoft download partner)

  2. Alternate Methods of WinPE:

    • The use of these are not recommended, I suggest downloading an ISO from above

    • BartPE (Free version of Windows XP PE - requires original install disc)

    • Windows Recovery Discs (Not free - $19.75)

  3. Fix NTFS partition from Ubuntu

share|improve this answer
    
I know there are some solutions here, but I wanted to give all I know, since some things weren't in other answers! –  Elijah Goforth Jun 8 '13 at 3:17
add comment

There isn't a fsck.ntfs in ubuntu and ntfsck doesn't fully implement ntfs.

Options:

1) If you have access to a Windows system you can connect the drive to it and run the windows file check utility (chkdsk)

2) If you have an optical drive you could obtain a boot cd and check the filesystem that way.

A couple I have used in the past with good results are:

http://www.ubcd4win.com/contents.htm

and

http://www.hiren.info/pages/bootcd

You should be able to boot off of one of those Cd's and chkdsk the drive/partition that you are having problems with.

share|improve this answer
add comment

You need to format the drive to EXT4. Backup first before you do these steps.

1

Open a terminal window and log in as root:

$ su (or "sudo su" on some distributions)

2

Find out the name of your hard drive. To do this, enter the following from the command prompt as root:

# fdisk -l

3

Choose your newly installed drive after fdisk lists the current drives. The current hard drive will already have partitions assigned, and the output will look like this:

Disk /dev/sda: 16.1 GB, 16139354112 bytes
 /dev/sda1 * 1 1874 15052873+ 83 Linux

/dev/sda2 1875 1962 706860 5 Extended

/dev/sda5 1875 1962 706828+ 82 Linux swap / Solaris

4

Check to see if your disk is already mounted with this command:

# df

5

Unmount your drive if it is mounted using this command:

# umount /dev/sdb

6

Create a new partition by typing this command:

# fdisk /dev/sdb

7

The fdisk prompt will open. Press "n" to make the new partition, and then press "Enter."

8

Press "p" to create a primary partition, and then press "Enter."

9

Press "1" to create the first partition followed by "Enter."

10

Enter the default for both the first and last cylinders when your computer asks for this information. This will make the partition cover the entire disk rather than just part of it.

11

Press "t" to change the file system type followed by "Enter."

12

Type "L" to see a list of known types followed by "Enter."

13

Type "83" for "Linux" followed by "Enter."

14

Press "w" to write the partition to the disk (this cannot be undone), and then press "Enter."

Format the New Partition

15

Format the new partition that you created with the following command:

# mkfs.ext4 /dev/sdb1

16

Create a new directory and mount the new drive with these commands:

# mkdir /media/newdrive (or whatever name you prefer)

# mount /dev/sdb1 /media/newdrive

17

Edit your fstab file so that the new drive will be mounted at boot. Fstab is the Linux file system configuration file to mount partitions at boot. You can edit /etc/fstab with the "nano" command or "vi" depending on which editor you prefer.

# nano /etc/fstab or # vi /etc/fstab

18

Add the following line to the end of fstab:

/dev/sdb1 /media/newdrive ext4 defaults 1 2

19

Save the fstab file.

Hope this helps!!!

share|improve this answer
    
:S So, I need format for use? :/ Thanks friend.. Not the best start in Linux for me –  Federico Ribero May 4 '13 at 16:26
1  
This will LOSE ALL DATA that is on the partition, which is not what the OP wants. –  ignis May 4 '13 at 18:02
    
2nd comment above. –  Elder Geek May 16 at 21:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.