You are not logged in.

#1 2011-08-24 21:43:18

Corubba
Member
From: Germany
Registered: 2010-11-14
Posts: 86

[solved] Hibernate corrupting NTFS-Filesystem

Hey Guys.

I'm running an Dualboot of Arch (x64) and Win7 (32bit) for a long time now, perfectly. sda1 is my ntfs formatted windows partion, sda2 and following arch. I have a little Script that hibernates arch and set grub to boot windows, it looks like this:

#!/bin/bash

echo "Press ENTER to boot Windows"
read -s -n 1

grub-set-default 2
suspend2disk

And it worked perfectly till today. The mistake was to make a new install of windows (the old one was messed up due some software testing), and i decided to use the x64 win7. I don't know if its cause of this. But now the hole hibernating thing is crashing my ntfs filesystem.

Steps to reproduce: umount and format sda1, suspend. Install windows, booted from an arch-cd and setting up my grub again. resumed arch, mount sda1 and copied some install sources to the windows desktop (i have the folder as bookmark in thunar), running the hibernate script and booted windows. I installed a hole bunch of things on windows, and deleted the install sources from desktop. After finishing this (no arch boot meanwhile), i rebooted and bring up my arch again. I opened Thunar and accessed the windows desktop. And surprise, there are the install sources on desktop. It shows the folder like before the hibernate. confused about this, i remounted the partition, but no change. Booting windows again results in an nice filesystem corruption error and a system rescue. So, the question is: Why?

I should say, that today i updated gamin (0.1.10-4 -> 0.1.10-5). Could this be the culprit? maybe just an accident that the reinstall of windows and the update happens the same day.

I will test to umount the ntfs before suspending, maybe it will help. Or maybe just remounting read-only will do the job.


So far, Corubba

Last edited by Corubba (2011-08-24 22:24:37)

Offline

#2 2011-08-24 21:57:36

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [solved] Hibernate corrupting NTFS-Filesystem

After resuming from hibernation, the system is supposed to be in the same state as before the hibernation. You cannot modify a hibernated mounted file system without corrupting it. A mounted filesystem can never be modified by a tool when it is mounted and this is exactly what you do. In principle remounting it read only is not sufficient either.

The hibernation cannot unmount all filesystems before hibernating because that would just mean rebooting the normal way, not hibernating (but it could make sense to unmount the specific filesystem you want to access, for example the Windows one).

In your situation, you have to fully unmount the windows ntfs partition before hibernating your computer and be sure you do not access the linux partition from windows in any way.

Offline

#3 2011-08-24 21:59:39

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] Hibernate corrupting NTFS-Filesystem

Corubba wrote:

mount sda1 and copied some install sources to the windows desktop, running the hibernate script and booted windows

Bad things happen if you don't unmount a filesystem before mounting it somewhere else.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2011-08-24 22:24:10

Corubba
Member
From: Germany
Registered: 2010-11-14
Posts: 86

Re: [solved] Hibernate corrupting NTFS-Filesystem

I see. I created the script /etc/pm/sleep.d/90ntfs

[user@computer ~]$ cat /etc/pm/sleep.d/90ntfs 
#!/bin/sh
#
# 90ntfs: umount/remount windows partition

case "$1" in
hibernate|suspend)
	umount /windows
;;
thaw|resume)
	mount /windows
;;
*) exit $NA
;;
esac

I think, it should do the job. Thanks for advise. Just wondering that i never before experienced such behavior ...

Greetz Corubba

Last edited by Corubba (2011-08-24 22:25:16)

Offline

Board footer

Powered by FluxBB