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

David C. Rankin drankinatty at suddenlinkmail.com
Fri Jun 26 10:28:17 EDT 2009


On Friday 26 June 2009 07:06:22 am Baho Utot wrote:
> 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.)
> 
> 

Thanks Baho,

	That is great information to add to my bag of tricks and -- hope I don't have to use it anytime soon ;-)

	What I liked about testdisk that I hadn't found anywhere else, was its 'scan' feature where it just scans the drive looking for partition boundaries and reports what it found giving you the opportunity to select what needs to be restored. It gives you a way to approach partition recovery without needing any prior knowledge of what is one the disk. One other neat trick is has is the ability to "View" the files on the partitions it has found which provides another check for determining the correct partitions.

	You can safely run testdisk on your hard drive and see what it does. Just don't hit "Write" and you will be fine (It also forces a confirmation prompt so you would have to make two mistakes to do any damage)

	I'll look at sfdisk, and thank you for the information.


-- 
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com


More information about the arch-general mailing list