[arch-general] dmraid Partitions Lost - Recovered -> Howto

Baho Utot baho-utot at columbus.rr.com
Fri Jun 26 08:06:22 EDT 2009


On Thu, 2009-06-25 at 22:49 -0500, David C. Rankin wrote:
> List,

[putolin]

> 
> 	(Note: if you were smart enough to save the "fdisk -l" information for  your drives, you can simply fdisk 
>          your array and be done)


This may bee of some use to you:

http://linux.die.net/man/8/sfdisk

I use 

The fourth type of invocation: sfdisk device will cause sfdisk to read
the specification for the desired partitioning of device from its
standard input, and then to change the partition tables on that disk.
Thus, it is possible to use sfdisk from a shell script. When sfdisk
determines that its standard input is a terminal, it will be
conversational; otherwise it will abort on any error. 
BE EXTREMELY CAREFUL - ONE TYPING MISTAKE AND ALL YOUR DATA IS LOST 
As a precaution, one can save the sectors changed by sfdisk: 
% sfdisk /dev/hdd -O hdd-partition-sectors.save
...
%
Then, if you discover that you did something stupid before anything else
has been written to disk, it may be possible to recover the old
situation with 
% sfdisk /dev/hdd -I hdd-partition-sectors.save
%
(This is not the same as saving the old partition table: a readable
version of the old partition table can be saved using the -d option.
However, if you create logical partitions, the sectors describing them
are located somewhere on disk, possibly on sectors that were not part of
the partition table before. Thus, the information the -O option saves is
not a binary version of the output of -d.)





More information about the arch-general mailing list