Re: LUKS partition gone?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 17, 2008 at 11:24:11AM +0000, Sean Bushby wrote:
> [root@eve log]# fdisk -l /dev/sdl
> 
> Disk /dev/sdl: 1000.2 GB, 1000215724032 bytes
> 255 heads, 63 sectors/track, 121602 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
> Disk /dev/sdl doesn't contain a valid partition table

I'm just a user of luks, but I know a few things about
filesystems. I don't know, however, if the partition
table is encrypted :/ (logically, I'd say it isn't).

If the partition table is not encrypted, then it
appears that your partition table got lost or is
corrupted. In that case you can recreate it by
running fdisk with the exact same parameters as you
used before (it will only overwrite the partition
table).

I'd suggest to make a backup of the first group (~100 MB)
plus some, too be safe, with dd:

dd if=/dev/sdl of=sdl.backup.100MB bs=4096 count=35000

You probably only need the first 512 byte ;).
Now run fdisk and rewrite the partition table.
If you have more than one partition and you can't
remember the start (heh - it WILL be the default,
no?) just try values with the end till the end of
the disk until you can (read-only!) mount it. Then
you have the start of /dev/sdl1. Next, guess it's
size (it sounds like you use the default here too,
and have just one partition for the whole disk),
trying until you can mount /dev/sdl2. Did you use
other types (ie, swap)... with a trial and error
it should be possible to recreate the partition
table like that. I can imagine that there are tools
our there that do this, but since you have to run
cryptsetup every time before you can try to mount,
I think this is your better option (doing it manually).
if the fdisk adventure fails for some reason, you
should always be able to restore to the beginning
by putting back the back up. Note that after running
fdisk the first time, you could use dd again,
hexdump (or xxd) that and the backup, and diff it.
It should show that only the first 512 bytes (the
partition table) are changed. If you see they are
changed from all zeroes to something with values,
then you know your on the right track. No need to
dump/diff 100 MB of course :P, just the first few kB
should be more than enough.

> [root@eve log]# cryptsetup luksDump /dev/sdl1
> Can't open device: /dev/sdl1
> Command failed.[root@eve log]# cryptsetup luksDump /dev/sdl
> /dev/sdl is not a LUKS partition
> Command failed.
> 
> 
> Is there anywayu to rebuild the volume?  The data must be there just it's
> lost it's header or something?
> 
> Thanks in advance,
> 
> Regards
> Sean

-- 
Carlo Wood <carlo@xxxxxxxxxx>

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux