Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT]: Powering off Windows XP, crashing NTFS with a Live CD.
Date: Sun, 03 Jul 2011 19:38:09
Message-Id: 201107031317.42848.michaelkintzios@gmail.com
In Reply to: [gentoo-user] [OT]: Powering off Windows XP, crashing NTFS with a Live CD. by Alan Mackenzie
1 On Sunday 03 Jul 2011 11:31:14 Alan Mackenzie wrote:
2 > Hi, Gentoo.
3 >
4 > There's been a cock and bull story on comp.os.linux.setup and I'm
5 > wondering about some of the details. Mainly, I'd like some education,
6 > please!
7 >
8 > The story, in essence:
9 > (i) Windows XP is running, with a normal NTFS filesystem(s).
10 > (ii) Power off without a proper shutdown.
11
12 Not particularly wise on NTFS. Upon next boot up it'll try to run chkdsk,
13 which you *must* not interrupt. 99% of the time it'll happily continue into a
14 normal boot.
15
16
17 > (iii) Start again with a Linux Live CD (distribution not specified).
18 > (iv) This corrupts the NTFS journal(s).
19
20 No it does not. The NTFS journals (or the MSWindows partition and its NTFS)
21 have nothing to do with a LiveCD booting and running exclusively in RAM.
22
23
24 > (v) It is now difficult to start Windows.
25
26 It would be without running chkdsk first, but you do not explain what the
27 difficulty amounts to ... error messages 'n all.
28
29
30 > OK. My questions:
31 > o - Do live CDs actually mount filesystems on HDDs?
32
33 Only when you ask them to.
34
35 To mount NTFS you would these days use ntfs-3g:
36
37 ntfs-3g /dev/sda1 /mnt/windows
38
39 or
40 mount -t ntfs-3g /dev/sda1 /mnt/windows
41
42
43 > o - If so, would the start-up actually write anything to a partition?
44
45 Nope. The start-up of a LiveCD happens in RAM.
46
47
48 > o - Would this actually try to mount an NTFS filesystem?
49
50 Linux LiveCDs will not typically mount anything whatsoever. They are by
51 default respectful of the devices on the system. I don't know if this
52 convention has changed recently, or if there are particular LiveCDs created
53 with different mounting conventions for the sake of MSWindows users - who
54 would not otherwise know how to mount a partition from Linux.
55
56 Can't recall what MSWindows based LiveCDs do (e.g. BartsPE).
57
58
59 > o - Given that Linux's NTFS doesn't (?yet) do journaling (see kernel
60 > docs), would the driver not detect the presence of a journal and leave
61 > well alone?
62
63 The Kernel's NTFS driver is not safe for writing to a NTFS partition. It is
64 mostly a read only driver (check the Help page of the module, next time you're
65 rolling up a new kernel). If you mount a NTFS partition using the kernel
66 driver and then try to write to it in a way that it requires a change to the
67 fs journals then you will invariably corrupt the NTFS fs. The working
68 solution for NTFS partitions these days is the ntfs-3g userspace application
69 as mentioned above.
70
71
72 CONCLUSION:
73
74 To recover a MSWindows partition which did not shutdown cleanly, boot into
75 MSWindows and let it run through the chkdsk sequence. When it finishes all
76 should be good.
77
78 If the MSWindows journal is corrupted, then you could try running
79
80 ntfsfix /dev/sda1
81
82 to force it to run chkdsk next time it boots.
83
84 When the MSWindows OS boots next time it will go through the chkdsk routine.
85 If that does not fix it either, then the journalling problem is probably
86 unrecoverable. In that case ntfs-3g won't work. Instead you could try
87 mounting the partition using the Linux kernel driver (read only of course) and
88 if it succeeds recover the files you need.
89
90 If the Linux kernel NTFS driver does not work, then we are into a full blown
91 recovery exercise. You could try testdisk and photorec. There are also a
92 bunch of MSWindows solutions too to recover NTFS partitions/files, but I'm not
93 sure if any of these are open source.
94
95 HTH.
96 --
97 Regards,
98 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies