Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to mount my Windows partition at boot. It works fine when Windows is in shutdown, but when Windows is hibernated, it can't be mounted as read/write, and I am sent to the root shell at boot. I tried to solve this by adding errors=remount-ro to my fstab, to mount it read-only if it can't be mounted as read/write when it is hibernated, but it doesn't work, and I still get an error at boot.

Is there a way to work around this and boot the partition as read/write when possible, but as read-only when it is hibernated?

# <file system> <dir>   <type>  <options>   <dump>  <pass>
UUID=1f026730-1640-42fa-b5f6-eca9749b3a98 /boot ext4 defaults 0 2
UUID=2b5c372b-d6d5-4c27-9c3f-5e26ca84d3a7 /home ext4 defaults 0 2
UUID=2c154114-4898-45e6-8455-575e910d8382 / ext4 defaults 0 1
UUID=92041326-03a7-4fdc-9211-c060e83d662e swap swap defaults 0 0
UUID=A28034F38034CF91 /media/win7 ntfs defaults,user,exec,dev,suid,errors=remount-ro 0 0
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

I ended up removing the line from /etc/fstab. I now mount the windows partition in ~/.xinitrc, by using the return code from mount:

#mount windows
sudo mount -o defaults,user,exec,dev,suid /dev/sda1 /media/win7
if [ $? -eq 14 ]
then
  sudo mount -o defaults,user,exec,dev,suid,ro /dev/sda1 /media/win7
fi

To be warned/informed about the way the partition is mounted, I also added the following to my conky config:

/dev/sda1 (Windows) is mounted:
${if_match "${exec mount | grep /dev/sda1 | grep -Eo [^a-z]ro[^a-z] | grep -o ro}" == "ro"}${font bold}${alignc}READ-ONLY: WATCH OUT!!!
${else}${alignc}R/W (normal)
${endif}
share|improve this answer
add comment

Is ntfs-3g installed? The man page says:

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 if you want to mount with read-write ability you have to remove the hibernate file with remove_hiberfile. I also remember using the force option to mount that partition anyway.

share|improve this answer
    
Yes, I know I have to remove the hiber file to mount it rw, I said that in the question. But I am looking for a solution where I don't have to remove it, and where it is mounted r/w when possible, but r/o when it is hibernated. –  BrtH Apr 19 '13 at 15:21
    
But I didn't know about the remove_hiberfile option, so if nothing else comes up I'm afraid I'll have to use that. –  BrtH Apr 19 '13 at 15:31
    
If it's an microsoft ntfs drive, you have to play by their rules! –  Shabgard Apr 19 '13 at 21:26
    
I don't think you want to use the remove_hiberfile option. I'm fairly certain that using it left my drive in an unsafe state and lead to an irrecoverably damaged Win7 installation. There wasn't any other change that I can remember before it happened that could have been blamed, but I can be 100% sure. –  Tyler Apr 3 at 14:50
add comment

It is the ntfs-3g driver that is refusing to mount the partition in write mode, unless one removes the hibernation file.

Without discussing whether it is a good idea to circumvent it, you could try to use another driver, such as the free Paragon NTFS&HFS for Linux 8.5 Express (registration required).

You might need to uninstall or disable ntfs-3g for this to work, but uninstallation is not guaranteed to work (or be easy to reinstall again). Better do the testing on a Linux system that can be restored in case of error.

share|improve this answer
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.