Gentoo Archives: gentoo-user

From: jcd <jcd@××××××.cz>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ext3 partition dissapeared :(
Date: Wed, 24 Jan 2007 18:14:12
Message-Id: 1169662149.11076.11.camel@paulie.kitchen
In Reply to: Re: [gentoo-user] ext3 partition dissapeared :( by Alan McKinnon
1 Alan McKinnon píše v Út 23. 01. 2007 v 21:55 +0100:
2 > On Tuesday 23 January 2007 19:47, Hans-Werner Hilse wrote:
3 >
4 > > Did you reboot between changing the partition layout and creating
5 > > that new partition (and moving data)? Otherwise the kernel wouldn't
6 > > be aware of the new partition layout. Well, if everything you wrote
7 > > is correct, that data should have ended up on that former Windows
8 > > partition and that partition should now be an ext3 one. But if you
9 > > just didn't care and mounted the old linux partition (sdb2 at that
10 > > point in time before the new partition layout), copied data and you
11 > > _then_ rebooted -- then you would have written your data to a
12 > > partition that was only a reminiscence in the kernel's structures and
13 > > not
14 > > corresponding to what cfdisk wrote to the HD. That would be an
15 > > explanation why the next boot failed.
16 > >
17 > > > When I do "mount /dev/sdb1 /mnt/zaloha" at /mnt/zaloha I see that
18 > > > old Windows NTFS partition that I already deleted (There are
19 > > > "Program Files", "WINDOWS", ...). I don't understand why (somewhere
20 > > > I read that ext3 start writing at the middle of the disk space to
21 > > > prevent defragmentation).
22 > >
23 > > Deleting the partition is something that only affects the boot
24 > > sector. Ext3 should in fact have overwritten this with it's first
25 > > superblock. So the mkext2fs you issued did definitively hit the wrong
26 > > partition.
27 > >
28 > > So my suggestion is: try "gpart -w ext2,1.5 /dev/sdb" to find your
29 > > partition (even better: write back the backup you've made from the
30 > > old partition table. Errrm...)
31 >
32 > Some background here to elaborate on what Hans has said:
33 >
34 > It looks like when you moved the data onto the new partition, it got
35 > written somewhere on the disk. However, the kernel's idea of how the
36 > partitions are laid out at that time and what fdisk just wrote to the
37 > disk probably don't agree and the kernel had got it wrong.... This does
38 > happen when you delete two or more partitions and create one large one.
39 >
40 > That's the bad news. The good news is that unless you did something to
41 > wipe the disk clean, the data is there somewhere and you need to find
42 > it. Hans' gpart command will search the disk looking for the sequence
43 > of data that is found at the start of a filesystem, and will then make
44 > a smart estimate as to what the partition ought to look like.
45 >
46 > The next good news is that you can create and delete partitions many
47 > times and still get the data back intact as long as you don't overwrite
48 > it. fdisk updates the partition table right at the start of the disk
49 > and does nothing else so you can always undo these changes. Until you
50 > are happy that everything is back it will be smart to mount this
51 > partition read-only so it can't be changed:
52 >
53 > mount -o rw /dev/sdb1 /path/to/mount/point
54 >
55 > You say in your original mail that after moving the data "everything was
56 > fine". What exactly do you mean by that:
57 >
58 > 1. The command ended without failure so you assume it moved stuff
59 > correctly, or
60 > 2. You proved the move was done by mounting the partition and all your
61 > files were there, or
62 > 3. Some other reason?
63 >
64 > alan
65 >
66
67
68
69 --
70 gentoo-user@g.o mailing list