Get ntfs-3g working with windows hibernate

Posted in Linux, Open Source by sandaruwan on March 18th, 2007

Several weeks ago, I installed ntfs-3g and it was working fine. However, It doesn’t mount the drive if windows is hibernated. I usually hibernate windows in my laptop, so I wasn’t having ntfs-3g in fstab, I just remount it when I need it. I was sick of this and came up with a very simple script which allows me to mount it in ntfs-3g if possible, and to use ntfs otherwise.

This is how to do it.

  1. Install ntfs-3g
  2. Just type sudo apt-get install ntfs-3g

  3. Edit your fstab
  4. Open /etc/fstab and change the mount type from “ntfs” to “ntfs-3g”

  5. Open /etc/init.d/mount-bak.sh
  6. Here is my script. Change your device and get options from the fstab. The device should be changed on both 2nd and 4th lines.

    #!/bin/bash
    mounted=`mount | grep sda1`;
    if [ "$mounted" = "" ]; then
    mount /dev/sda1 /media/sda1 -o ‘defaults,nls=utf8,umask=007,gid=46′
    fi

    Change the permission of the script by running sudo chmod a+x /etc/init.d/mount-bak.sh

  7. Change the run level
  8. sudo ln -s /etc/init.d/mount-bak.sh /etc/rcS.d/47mount-bak.sh

Leave a Reply