osttso wrote: 22 Oct 2022, 16:41
My laptop battery died and the machine did a hard shutdown. When I rebooted I got the message "no bootable drive found".
My setup is a 250GB SSD with the filesystem and home directory with a secondary 500GB SSD for storage. The main drive is Ubuntu 22.04 LTS with LUKS encryption.
When I boot up a live USB (Ubuntu) I can see the main drive (sda) but it should have partitions and they are not listed with lsblk.
I can't see your partitions either. Wouldn't it be a good idea to describe those partitions?
The drive itself is not listed with blkid and it seems the labels and UUID for the disk are gone.
Are you talking about a disk or a partition? The term "drive" is confusing.
I cloned the disk to a 480GB SSD using dd, which is what I am working on fixing to keep the original untouched.
Which disk did you clone?
I have tried mounting in various ways
Mounting an encrypted disk or partition is not possible in various ways when encryption comes into play
and using fsck
You cannot do a file system check on an encrypted disk or partition because it is not readable because it is encrypted.
. I did a quickscan and deeper scan with testdisk last night and nothing was showing up so I tried to force e2fsck, but that just erased the disk. I re-cloned the drive over night.
You did not describe your LUKS setup. There is no way for me to judge if the one partition found is a good result.
I decided to try PhotoRec, as suggested by another post here when there are no partitions listed. When I did that I could see files, but I don't think trying to recover them will work since the drive is encrypted. After that I tried testdisk again and now a single partition shows up. Log can be seen here:
https://pastebin.com/mhLzsJ54
Is there any hope for restoring my partition table and/or retrieving my files?
Right now I don't see any hope.
I have another machine set up with Ubuntu + LUKS, is there a way I can use the partition table there and clone it to my main laptop or will the tables be completely different (I should say I have a very, very rudimentary understanding of blocks)?
Is there anything else I can try?
Delivering a precise description. Technically your case is a black box for me despite your description. I guess that your other machine is set up the same way as the broken one. You could even reinstall your system on a new disk the same way you installed your broken one to find out how your system is like in terms of partitions.
Uploading pictures and log files to this site keeps your case readable for others. Third party hosting may disappear.
Code: Select all
Sat Oct 22 14:56:44 2022
Command line: TestDisk
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 5.4.0-42-generic (#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020) x86_64
Compiler: GCC 9.2
ext2fs lib: 1.45.5, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.1
/dev/sda: LBA, HPA, LBA48 support
/dev/sda: size 937703088 sectors
/dev/sda: user_max 937703088 sectors
/dev/sda: native_max 937703088 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 480 GB / 447 GiB - CHS 58369 255 63, sector size=512 - KINGSTON SA400S37480G, S/N:50026B7784CA934A, FW:SBFKB1H5
Disk /dev/sdb - 8100 MB / 7725 MiB - CHS 1020 250 62, sector size=512 - Sony Storage Media, FW:0100
Disk /dev/loop0 - 2103 MB / 2006 MiB - 4108672 sectors (RO), sector size=512
Disk /dev/loop1 - 31 MB / 29 MiB - 61200 sectors (RO), sector size=512
Disk /dev/loop2 - 57 MB / 54 MiB - 112552 sectors (RO), sector size=512
Disk /dev/loop3 - 267 MB / 255 MiB - 523400 sectors (RO), sector size=512
Disk /dev/loop4 - 65 MB / 62 MiB - 127160 sectors (RO), sector size=512
Disk /dev/loop5 - 52 MB / 49 MiB - 101960 sectors (RO), sector size=512
Partition table type defaults to Intel
Disk /dev/sda - 480 GB / 447 GiB - KINGSTON SA400S37480G
Partition table type: Intel
Analyse Disk /dev/sda - 480 GB / 447 GiB - CHS 58369 255 63
Current partition structure:
Partition sector doesn't have the endmark 0xAA55
search_part()
Disk /dev/sda - 480 GB / 447 GiB - CHS 58369 255 63
block_group_nr 2187
recover_EXT2: "e2fsck -b 71663616 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2187/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212886
recover_EXT2: part_size 937703088
Filesystem created: Sat Oct 22 01:16:57 2022
Linux 0 0 1 58369 80 63 937703088 [ffs]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Partition not added.
block_group_nr 2187
recover_EXT2: "e2fsck -b 71663616 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2187/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212416
recover_EXT2: part_size 937699328
Filesystem created: Sat Oct 22 04:05:22 2022
Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Results
* Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 937699328 linear /dev/sda 2048" | dmsetup create test0
interface_write()
1 * Linux 0 32 33 58369 53 52 937699328
search_part()
Disk /dev/sda - 480 GB / 447 GiB - CHS 58369 255 63
block_group_nr 2187
recover_EXT2: "e2fsck -b 71663616 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2187/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212886
recover_EXT2: part_size 937703088
Filesystem created: Sat Oct 22 01:16:57 2022
Linux 0 0 1 58369 80 63 937703088 [ffs]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Partition not added.
block_group_nr 2187
recover_EXT2: "e2fsck -b 71663616 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2187/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212416
recover_EXT2: part_size 937699328
Filesystem created: Sat Oct 22 04:05:22 2022
Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
block_group_nr 2401
recover_EXT2: "e2fsck -b 78675968 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2401/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212886
recover_EXT2: part_size 937703088
Filesystem created: Sat Oct 22 01:16:57 2022
Linux 0 0 1 58369 80 63 937703088 [ffs]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Partition not added.
block_group_nr 2401
recover_EXT2: "e2fsck -b 78675968 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=2401/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212416
recover_EXT2: part_size 937699328
Filesystem created: Sat Oct 22 04:05:22 2022
Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
block_group_nr 3125
recover_EXT2: "e2fsck -b 102400000 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3125/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212886
recover_EXT2: part_size 937703088
Filesystem created: Sat Oct 22 01:16:57 2022
Linux 0 0 1 58369 80 63 937703088 [ffs]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Partition not added.
block_group_nr 3125
recover_EXT2: "e2fsck -b 102400000 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3125/3577, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 117212416
recover_EXT2: part_size 937699328
Filesystem created: Sat Oct 22 04:05:22 2022
Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Results
* Linux 0 32 33 58369 53 52 937699328
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 480 GB / 447 GiB
Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 937699328 linear /dev/sda 2048" | dmsetup create test0