Skip navigation

I have been struggling with a bug in NTFS-3G where NTFS will refuse to mount due to hibernation or Windows 8 fast restart being enabled, even if I specify the read-only mount option as suggested by the “Windows is hibernated; refusing to mount” error text:

mount.ntfs-3g -o ro /dev/sda4 /mnt/sda4

The following simple patch fixes the bug and allows read-only mounts even if hibernated or in fast restart mode.

diff -Naur a/src/ntfs-3g.c b/src/ntfs-3g.c
--- a/src/ntfs-3g.c	2014-02-15 09:07:52.000000000 -0500
+++ b/src/ntfs-3g.c	2014-08-15 12:52:07.543346848 -0400
@@ -3427,7 +3427,12 @@
 	if (ctx->hiberfile && ntfs_volume_check_hiberfile(ctx->vol, 0)) {
 		if (errno != EPERM)
 			goto err_out;
-		if (ntfs_fuse_rm("/hiberfil.sys"))
+		/* Modified by Jody Bruchon to allow read-only mount
+		 * even if system is hibernated or in fast restart mode.
+		 * This fixes the bug where '-o ro' is suggested as a
+		 * workaround but the workaround does not actually work.
+		 */
+		if (!ctx->ro && ntfs_fuse_rm("/hiberfil.sys"))
 			goto err_out;
 	}

This is an ancient problem, but I seem to run into it frequently and even briefly forget it. When you open an X terminal emulator such as Xterm or rxvt, you might be frustrated by the fact that you can’t get a profile or startup script to run in the shell prior to displaying a prompt. Your shell prompt also defaults to something fairly useless like “sh-4.3$” instead of something more informative and fancier.

This occurs because your user account’s default shell is either not explicitly set or is set as /bin/sh rather than /bin/bash. To fix this you’ll need to run the following command as root (i.e. with su or sudo):

usermod -s /bin/bash your_user_name

You’ll need to log out and back in before the change will fully take effect; alternatively, if you’re starting X from a command prompt, you can drop out of X, export SHELL=/bin/bash, and start X again. This can also be done in your .profile or .bashrc as a workaround if you don’t have root access for some reason and don’t use a graphical login manager.

There’s a super quick fix for this problem: stop the Windows Update service, delete the SoftwareDistribution folder in the Windows folder, and start the Windows Update service.

For some reason, the rest of the Internet doesn’t seem to have the fix. Let me know if this helps you!

Follow

Get every new post delivered to your Inbox.

Join 68 other followers

%d bloggers like this: