List Info

Thread: another mistakenly deleted partition to recover :(




another mistakenly deleted partition to recover :(
user name
2006-09-28 05:08:36
In the aftermath of my recent disaster in which I
accidentally
reformatted my root partition I have been trying to install
a new
system. Unfortunately this has led to some more partitions
being
accidentally deleted and one of them had important data on
it I need to
recover.

Unlike last time, this time the error was not mine. It was a
fault
either in the Gentoo Linux Installer or in whichever utility
it uses to
deal with partitions.

This is what happened.

I booted the live CD with evms enabled.

At the start there were two primary partitions on the disk
in question,
followed by one extended one. The extended one in turn had
four logical
partitions.

When I started the installer I went through all the screens
and told it
what I wanted. When it came to partitioning I told it to
delete the
first primary partition and replace it with one the same
size, and to
delete the first logical partition and replace it with one
the same size
also. This one was to be formatted reiserfs. I then saved my
settings
before setting the installer to work.

It appeared from the messages that the installer had
reformatted deleted
and replaced the first logical partition (although I don't
know whether
it formatted it or not), but it borked when it came to the
first primary
partition, saying that it was in use by the system. It
wasn't mounted so
I suspected this might have had something to do with evms,
but that
didn't make sense to me because both of the partitions in
question had
entries in /dev/evms, but only one could be deleted and not
the other. I
decided not to use evmsn to edit them and instead to try
again with the
gentoo installer.

I started up the installer a second time (well, a fifth time
actually)
and reloaded my settings from before. I was a bit puzzled
when it came
to the partitioning screen because there was no easy way to
tell whether
the partition diagram it displayed was how things actually
were, or was
how things were supposed to be after various operations were
carried
out. However I didn't want to spend all night choosing my
use flags over
and over again each time the installer failed so I went
ahead with the
settings from previously.

This time the installer complained that it couldn't have two
partitions
in the same place, or something like that. I don't remember
exactly. So
I started the installer again, reloaded my settings and
found that the
three partitions after the logical partition I wanted
replaced had now
all been deleted.

When I looked at the partition layout in parted I was
surprised to find
that the logical partition I had wanted replaced was now
larger than it
had been. It had been around 98GB or 99GB, but now it was
105GB. This
would be large enough to extend into the space occupied by
the second
and third logical partition, but not the fourth, which was
nonetheless
deleted too. parted listed no file system type for the
remaining logical
partition, so I don't know whether it has been formatted
(with reiserfs)
or not. I suppose I should have tried to mount it -ro to
check, I can go
back and do that if it would be useful.

Anyway, the partition I now need to recover would be the
third logical
partition (the one that the remaining logical partition just
overlaps).
Am I right in thinking that if the remaining logical
partition has in
fact been formatted, that the only changes that will have
been made to
the disk will have been at the beginning of that partition,
and that
therefore the data from the third partition ought to be
intact?

Presumably then I simply need to find out where the
beginning of that
partition would have been and to create another one of a
sufficient size
starting in the same place (having deleted the first logical
partition
of course). Is that right?

If so, how can I determine where the beginning would have
been of that
deleted partition? It was, in its former life, an ext3
partition.

Many thanks
Robert

-- 
gentoo-usergentoo.org mailing list

another mistakenly deleted partition to recover :(
user name
2006-09-28 09:14:38
Hi,

Have a look at sys-block/gpart, it can probably help you.

In your other thread you mentioned you had no space for
backing up a 
partition. Too bad I didn't have the idea earlier, but you
could create 
a "copy on write" partiton, for example with
network block devices (needs 
kernel support and sys-block/nbd) or sys-fs/cowloop. This
way, you could 
rescue any data, without touching your original partition
and you have no 
need to backup the whole partition.

/Wolfgang
-- 
gentoo-usergentoo.org mailing list

another mistakenly deleted partition to recover :(
user name
2006-09-28 20:59:26
On Thu, 2006-28-09 at 11:14 +0200, Wolfgang Illmeyer wrote:
> Hi,
> 
> Have a look at sys-block/gpart, it can probably help
you.

Yes, I discovered gpart last night. It can be a useful tool
for
partition problems, although in this case it has turned out
that
testdisk was what I needed.

gpart doesn't deal with logical partitions very well. It
took hours for
it to find my old partitions and even then it is left to you
to do some
quite gruesome arithmetic to work out where the start of
your partition
actually is. I just couldn't recreate a valid partition that
way.

testdisk on the other hand immediately identified all the
deleted
partitions and I only needed to select one button to write
them back to
the partition map. After opening and saving them again in
fdisk to make
the kernel aware of the changes I had my files back again.

However if you have changed anything on your disk apart from
the
partition map you will need to use gpart and may the gods
have mercy on
your soul.

> In your other thread you mentioned you had no space for
backing up a 
> partition. Too bad I didn't have the idea earlier, but
you could create 
> a "copy on write" partiton, for example with
network block devices (needs 
> kernel support and sys-block/nbd) or sys-fs/cowloop.
This way, you could 
> rescue any data, without touching your original
partition and you have no 
> need to backup the whole partition.

Never heard of this before. Will have to look into it. Could
never work
out a good backup strategy, which is why I got in this mess.

I'll probably give gentoo a rest for now after all this. Try
a live CD
for while--musix or dynebolic or something--see how I get on
and decide
from there. I've learned a lot using gentoo but it's getting
very time
consuming maintaining everything. After installing Ubuntu
Dapper on a
couple of other machines my expecations of a Linux distro
have become a
lot more demanding. I don't need to do everything. What I
need most is
for music and video stuff to work without a lot of
maintenance. Let
someone else with more sense than I am ever likely to have
choose the
CFLAGS because my builds of rosegarden and whatnot are far
too unstable.

But as I've said before, one thing that gentoo really has
going for it
is a patient and knowledgeable user base. I've found the
ubuntu
community to be very welcoming too, although generally it
lacks the
accumulation of experience with hard problems that marks
gentoo users
out.

Robert

Robert

-- 
gentoo-usergentoo.org mailing list

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )