0

I recently tried to dual boot install Linux on my Windows laptop it failed and my Windows boot partition and files are inaccessible. Linux is bootable and I can see two drives using lsblk - nvme0n1 and nvme1n1

nvme1n1 is my existing partition in which Linux is working in and nvme0n1 is the inaccessible partition which currently from the size should have the WIndows OS and files. Is there a way to recover the files from the inaccessible nvme0n1 drive? I tried testdisk/photorec and Gparted without any success. I cannot access the nvme0n1 drive from Grub command prompt or the windows recovery command prompt.

Appreciate any help and pointers.

thank you very much

Additional information and edits:

The windows drive nvme01 and associated partition does not show up when I do ls in Grub Command line nor the window rescue command prompt when I use disk part. The windows partition is encrypted using bit locker.

the output from sudo nvme command –

Smart Log for NVME device:nvme0n1 
namespace-id:ffffffff 
critical_warning : 0 
temperature : 89 °F (305 K) 
available_spare : 100% 
available_spare_threshold : 50% 
percentage_used : 7% 
endurance group critical warning summary: 0 
Data Units Read : 46,067,151 (23.59 TB) 
Data Units Written : 42,110,803 (21.56 TB) 
host_read_commands : 1,271,944,287 
host_write_commands : 1,074,384,126 
controller_busy_time : 23,817 
power_cycles : 1,590
power_on_hours : 16,525 
unsafe_shutdowns : 200 
media_errors : 0 
num_err_log_entries : 0 
Warning Temperature Time : 0 
Critical Composite Temperature Time : 0 
Thermal Management T1 Trans Count : 99 
Thermal Management T2 Trans Count : 23 
Thermal Management T1 Total Time : 10748 
Thermal Management T2 Total Time : 743

EDITS:

fdisk -l on /dev/nvme0n1 shows a partition /dev/nvme0n1p1 of type GPT. This partition has Windows installation and user files.

When I use sudo dislocker with -pbitlockerkey option on the drive /dev/nvme0n1I get an error "Cannot parse volume header. Abort."

EDITS: Here is the output of fdisk and dislocker

% sudo fdisk -l /dev/nvme0n1

Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors Disk model: H10 HBRPEKNX0202A NVMe INTEL 512GB
Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type

/dev/nvme0n1p1 1 4294967295 4294967295 2T ee GP

% sudo dislocker -V /dev/nvme0n1p1 -pxxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx /mnt/bitlocker

Wed Feb 19 17:27:15 2025 [CRITICAL] Failed to open /dev/nvme0n1p1: No such file or directory

12
  • 3
    You're rushing too far ahead with testdisk/photorec. Please first describe in what way it is inaccessible. What regular methods did you try to access it, and what results did you get? Commented Feb 18 at 7:46
  • Do you have the nvme command-line tool installed (the package name might be nvme or nvme-cli, depending on distribution)? If yes, run sudo nvme smart-log /dev/nvme0n1 and copy/paste the output into your original question post. Alternatively, try sudo smartctl -x /dev/nvme0n1, and also copy/paste the output into your original question. Don't attempt to add the outputs as comments - they are way too long for that. Commented Feb 18 at 7:54
  • Formal note in the context of the previous comment: even if the output was short enough for a comment, its place would be in the body of the question nevertheless. Paste the output into your original question because it belongs there, not because it is long. Commented Feb 18 at 8:00
  • Is the Windows partition by any chance encrypted? Microsoft has lately been pushing disk encryption by default using Bitlocker. For instructions on how to find out if encryption is enabled, search the web for "how to check if bitlocker is enabled". Commented Feb 18 at 12:58
  • The windows drive nvme01 and associated partition does not show up when I do ls in Grub Command line nor the window rescue command prompt when I use disk part. The windows partition is encrypted using bit locker. I will install nvme tool try the suggested commands and post back the results. Thanks Commented Feb 19 at 8:49

1 Answer 1

0

With NVMe in Linux, device names are like /dev/nvmeXnY where X is the NVMe device number, and Y is the namespace number. When partitioned, there is a third number: device names for NVMe partitions are of the form /dev/nvmeXnYpZ where Z is the partition number.

The namespace number is essentially for enterprise-grade hardware only: for consumer-grade NVMe drives, usually only one namespace is supported, and thus the namespace number will always be 1.

So: if you run fdisk -l /dev/nvme0n1, does it list any partitions?

If there are no partitions visible at all, Bitlocker might be using the NVMe drive's built-in hardware encryption support, which could make recovery trickier. It might be that only a real Windows system can extract the hardware encryption passphrase/key from the Bitlocker recovery key.

But if fdisk can list the partitions, then something like dislocker could be used to unlock the encryption and make the NTFS filesystem(s) mountable.

See also this question at SuperUser.SE for a lot of information on accessing a Bitlocker-encrypted drives on Linux.

sedutil-cli is a Linux tool which can be used to lock/unlock drives that have Opal-compliant hardware encrypting functionality, but unfortunately that tool doesn't know how to use a Bitlocker recovery key for unlocking a hardware-encrypted drive. You can read the linked page to gain an understanding of what is going on, and you could use the sedutil-cli tool to check if your drives have the hardware encryption feature and if it is currently locked or not.

But if Bitlocker is using the hardware encryption feature, then as far as I know, sedutil-cli alone cannot unlock the drive; you'll need to plug the drive as a second drive to a working Windows system that supports Bitlocker, and then supply the recovery key when Windows asks for it.

Since you apparently can see at least one partition with fdisk -l /dev/nvme0n1, you should try using dislocker with that partition /dev/nvme0n1p1. You'll need to specify a mount point for dislocker, and it will create a virtual filesystem which will contain an unencrypted NTFS filesystem image you can mount.

In other words, if you do:

mkdir /mnt/bitlocker
dislocker -p <Bitlocker recovery key> -V /dev/nvme0n1p1 /mnt/bitlocker
mkdir /mnt/unencrypted
mount -o loop /mnt/bitlocker/dislocker-file /mnt/unencrypted

... then you should be able to access the encrypted partition at /mnt/unencrypted/.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.