Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] ext3 partition dissapeared :( jcd <jcd@××××××.cz>
Re: [gentoo-user] ext3 partition dissapeared :( jcd <jcd@××××××.cz>