Partition-Rescue(1).pdf
(
29 KB
)
Pobierz
Partition-Rescue HOWTO
Partition−Rescue HOWTO
Jean−Daniel Dodin
Revision History
Revision v3.5
2003−10−31
Revised by: jdd
Major update − new licence − some fixes in addresses − vi use :−)
Revision v3.4
2002−08−22
Revised by: jdd
Minor update related only with docbook
Revision v3.3
2001−11−17
Revised by: jdd
Minor update − docbook & revision history − emacs use.
Revision v3.2
2001−09−25
Revised by: jdd
Major update.
Whow ! my disk is empty ! My Linux is gone ! If you have or fear to have one day or an other such a
problem, read this...
Partition−Rescue HOWTO
Table of Contents
1. Beginning.
........................................................................................................................................................1
1.1. What's in.
..........................................................................................................................................1
1.2. What to do right now ?.
.....................................................................................................................1
1.3. Legal stuff.
........................................................................................................................................1
1.4. What do I must know right now?.
.....................................................................................................2
2. Technical info.
.................................................................................................................................................3
2.1. Disks
.................................................................................................................................................3
2.2. Partitions.
..........................................................................................................................................3
2.3. Why is there a problem ?.
.................................................................................................................4
3. Solving the problem.
.......................................................................................................................................5
3.1. The simpler case.
..............................................................................................................................5
3.2. A not so simple case
.........................................................................................................................6
3.2.1. By hand..
..................................................................................................................................6
3.2.2. Linux own info and other hacks.
.............................................................................................6
3.2.3. gpar.
........................................................................................................................................7
3.3. The rich man case.
............................................................................................................................9
4. References.
.....................................................................................................................................................10
4.1. Authors.
...........................................................................................................................................10
4.2. Most recent version.
........................................................................................................................10
i
1. Beginning
1.1. What's in
This HOWTO addresses only the "lost partition table" problem. This can be when :
·
you have installed a new system (i.e. MS Windows) and you see no more Linux, and MS Windows
take up all the capacity of the disk ;
you have no more access to your computer, with the "no operating system" message ;
·
·
you have just partitioned the wrong drive with fdisk (for example in the way of changing your hard
drive).
Here you will learn that if you know the right thing and do it, Linux comes usually safe from such things. MS
Windows can, but it's luckier.
We will first see what you can do
before
the problem to ease the future recovery and what you must do
after
to recover. There is little to do to prevent from erasing a disk, usually this is done by automatic MS Windows
or Linux−install ill behaved programs or users mistakes − nothing can be done to prevent this except care, but
you are already careful, isn't it ?
It can also be done by the use of MSDOS/Windows fdisk. Avoid it as most as you can, but you probably can't.
I have done this many times, on my computer and on others guy computers and restored Linux most of the
time and MS Windows sometimes. I wish you luck !
1.2. What to do right now ?
If you don't have any problem yet, if you read this by curiosity or just seeking information and you are on a
running Linux system, do immediately the following :
·
key in "/sbin/fdisk −l" (that last character being l for Lima). Then do fdisk −u −l ;
open a root terminal or xterm ;
·
You will be gratified by a list of all current partitions on all disks presents on your computer. The second one
gives the listing in sectors units in place of cylinder and this is sometime necessary.
·
Write this back on paper (or do "/sbin/fdisk −l | lpr" and "/sbin/fdisk −u −l | lpr" to print it) and save it
in a safe place for future use.
If you are not the system administrator, you should not be concerned by the problem and can stop reading this.
1.3. Legal stuff
This HOWTO is Copyright (c) 2000−2001 by Jean−Daniel Dodin.
As of November 2003, the licence is LGPL.
1. Beginning
1
Partition−Rescue HOWTO
I am not responsible of any damage on any computer as a result of anyone reading this HOWTO. If you do
any damage, _it is YOUR fault, NOT MINE_! Be careful when partitioning disks, and don't make any
mistakes, because it can be fatal ! Backup all your important data and check that everything you do is correct !
What is described here worked on my computer, but it may or may not work on your computer. Although it
should work for everyone, I can't guarantee anything. This is the last warning you get: BACKUP
IMPORTANT DATA ! Or, to put it short: Use at your own risk !
1.4. What do I must know right now?
You
must
know that in case of any major problem with your hard disk, you
must
stop using it at all in
write
mode, at least the time necessary to understand what happens. Information there is very volatile...
If ever, one morning, awaking, you computer say "can't load, no system installed", you
must not begin
reinstalling all the stuff
.
If you have MS Windows installed, I can't promise you can recover your data, but it's likely you will recover
all your Linux stuff, provided it's not located too low (near the beginning of the disk) in the disk structure.
This is because some MS Windows viruses erases the very first disk cylinder, whatever is on. However I
didn't ever experiment such virus and can't say for sure. Try recovering anyway.
You must also know that I give you all this information only for this − information purpose. Neither I nor any
other people but you can be held responsible for any problem your data can have using this info. There are too
many different systems on the world for anybody being able to promise anything. I can only wish you luck
and hope you, like me, will be happy recovering data.
1. Beginning
2
2. Technical info
2.1. Disks
A hard disk is made of sectors numbered from 0 to the max.
dmesg gives, for example:
hdb: ST34321A, 4103MB w/128kB Cache, CHS=523/255/63
CHS means Cylinders, Heads, Sectors.
523*255*63=8401995 sectors of 512 bytes, thus the 4103 Mbytes. This is only a logical map, it's not
necessarily what is written on the disk cover (except for the total size).
The true size of the sectors is of no interest for us given we don't want to modify anything but restore a
previous state. For us, the default size given by fdisk is alright.
The size seen by the system is directly dependent of the work of the BIOS (Basic Input/Output System − the
PC's ROM). The mode of the hard disk indicated in the BIOS is essential. On a new disk, it's better to use
BIOS automatic hard disk recognition and say "yes". Anyway, any modification at this level may destroy all
the data of the disk, so don't play with this without essential reason.
This is probably what your disk use, so don't be afraid.
2.2. Partitions
Disk are now huge, 40 Gb are not rare, so that it's not really handy to have all this stuff packed in only one
part. Only MS Windows do so, and if you use Linux, may be it's because you are aware of how inefficient the
other is.
So a hard disk is usually cut in some pieces called "partitions" (see the "partition HOWTO" for details, also
read /usr/share/doc/package/util/README.fdisk)
Let's get a look at (part of) my own print of fdisk −l :
Disk /dev/hdb: 255 heads, 63 sectors, 523 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 153 1228941 83 Linux
/dev/hdb2 154 166 104422+ 82 Linux swap
/dev/hdb3 * 167 291 1004062+ 83 Linux
/dev/hdb4 295 523 1839442+ 5 Extended
/dev/hdb5 295 422 1028128+ 83 Linux
/dev/hdb6 423 523 811251 6 FAT16
This is my second hard disk, tied to guesses and tries (the first is too simple to be interesting).
/dev/hdb is my second ide disk (slave on the primary interface),
2. Technical info
3
Plik z chomika:
megaskrypty
Inne pliki z tego folderu:
3-Button-Mouse(1).pdf
(58 KB)
XWindow-Overview-HOWTO(1).pdf
(30 KB)
Xterm-Title(1).pdf
(39 KB)
Xterminals(1).pdf
(30 KB)
Xinerama-HOWTO(1).pdf
(33 KB)
Inne foldery tego chomika:
Programowanie
Zgłoś jeśli
naruszono regulamin