Results 1 to 5 of 5

Thread: Accidentally partitioned a LUKS encrypted drive

  1. #1
    Join Date
    May 2008
    Beans
    27

    Accidentally partitioned a LUKS encrypted drive

    I was a major idiot as I was installing a new hard drive and accidentally partitioned /dev/sdb instead of /dev/sdc, which was already partitioned and encrypted with LUKS.

    I'd created a new partition on (apparently spanning the entire drive somehow?) and written the new partition tables before I caught my mistake. Imagine the massive facepalm.

    Funny thing is that, when I go into the Disk Utility, it still shows as encrypted and I can luksOpen the drive just fine, even accepting my password - but when I try to mount it, it tells me that I must specify the filesystem type. Forcing a mount of a ext3 filesystem gives me this:

    Code:
    # mount -t ext3 /dev/mapper/drive1 /media/drive1
    mount: wrong fs type, bad option, bad superblock on /dev/mapper/drive1,
           missing codepage or helper program, or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    How the hell do I revert this or how will I save my data, if at all possible?

    Funny thing is that Disk Utility seem to show me 2 2 TB partitions on 1 2 TB hard drive. As seen here.
    Last edited by trillex; December 8th, 2012 at 04:12 PM. Reason: Image

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-land
    Beans
    12,216
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Accidentally partitioned a LUKS encrypted drive

    Quote Originally Posted by trillex View Post
    how will I save my data, if at all possible?
    I hope you have a good backup somewhere that you can restore. Otherwise, it is going to be a very long effort. photorec might be able to help a little, but it is not a trivial effort in my experience.

  3. #3
    Join Date
    May 2008
    Beans
    27

    Re: Accidentally partitioned a LUKS encrypted drive

    Quote Originally Posted by TheFu View Post
    I hope you have a good backup somewhere that you can restore. Otherwise, it is going to be a very long effort. photorec might be able to help a little, but it is not a trivial effort in my experience.
    I can't even "find" the filesystem so I'm thinking of just calling it a sour learning experience and wipe the drive completely.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-land
    Beans
    12,216
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Accidentally partitioned a LUKS encrypted drive

    When using encryption, it is critical to have excellent backups. Absolutely critical.

  5. #5
    Join Date
    Nov 2009
    Location
    de9fdc5c1ade9d205ac5e2622
    Beans
    Hidden!
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Accidentally partitioned a LUKS encrypted drive

    Give TestDisk a try. I once reformatted my Window's XP NTFS partition to FAT32 with gparted. After doing a deep scan I was able to restore to the original partition table and format without any lose of data. It was quite incredible really. After restoring the boot manager I had my computer back like nothing had happen. I ended up donating 25 dollars to the guy (I'm a poor grad student or I would have given him much more). Of course I would strongly advise you to clone your drive and work on the clone so you don't do irreversible damage to the drive while trying to restore.

    I have the instructions I used to recover somewhere, I will try and find them and post them within 24 hours.
    "Si Dieu n'existait pas, il faudrait l'inventer" -Voltaire

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •