Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HELP! BTRFS device locked: wrong encryption key

Featured Replies

Hi, I'm running Unraid 6.8.0 and I had no issue whatsoever with my filesystem so far despite several motherboard switches.

I decided to add a new 10TB drive to my Array, pre-clear was successful, and when I started the Array I had to format the disk, I clicked yes and surprise to me, it did it with BTRFS encrypted which never was my intention. My other drives runs with XFS which I'm fine with.

2143569724_ArrayDevices.png.7b3379406235cac75bd3c783b4e97397.png

Everything went well, I decided to also encrypt my existing drives using space invaders method with new disk config and after deleting the XFS partition I repopulated the array same as before and agreed to format the drive. 

When the array restarted, both encrypted device were in red locked! I managed to do a new config again and leave the new 10TB to unassigned. I could access it via Krusader and scatter the data to the intact XFS drives. Reformat the new 10TB again with BTRFS.

I had to do the same with the 2TB backup drives. Which worked.

 

I was stupid enough to believe that not mounting the drives, empty them as unassigned device, delete the partition and reformat after restarting the array would work fine with my other 2 XFS drives even if the method is a pain in the ass.

Now the problem is: my Disk2 is also under BTRFS encrypted and locked, when I stopped the array and tried the method above it was impossible for to mount any of the BTRFS disk with unassigned devices and access them via Krusader. As it was empty I just deleted again the partition, restarted the array, format and this is what I got now:

 

image.png.ba9430f830d8a1218a15044378249fb5.png

 

Disk 1 is XFS untouched and full

Disk 2 is now BTRFS encrypted and empty

Disk 3 is now BTRFS encrypted and "device locked: wrong encryption key"

Disk 4 is now BTRFS encrypted and "device locked: wrong encryption key"

 

I absolutely need to access my data on disk 3 and 4 but since I can't mount them as unassigned I don't know and I need your help!

Is there a way to unlock the drive when in the array and access the data? or mount them again as unassigned.

Ultimately I want to switch back to XFS once done.

 

Note: The drives are physically on the same sata port as before, I only added the Disk4

I also never changed the passphrase and HTTPS is working fine since 6.4.0

I don't want to mess around anymore, I know all drives are intact I just can't unlock disk3 and 4.

cerebro-diagnostics-20191216-1519.zip

Edited by Cererbo
Diagnostic fil added

  • Community Expert
19 minutes ago, Cererbo said:

it did it with BTRFS encrypted which never was my intention.

New devices will be formatted with the filesystem set on Settings -> Disk Settings

 

21 minutes ago, Cererbo said:

Now the problem is: my Disk2 is also under BTRFS encrypted and locked,

Disk2 is xfs:encrypted.

 

With the array stopped click on disks 3 and 4 and change the filesystem to btrfs:encrypted, if that doesn't work try xfs:encrypted, post new diags after trying both if it still doesn't work with either option.

  • Author

This is how it looks like now:

I did what you recommended but it didn't worked. After that, I reformat Disk2 to match Disk3 and 4 with BTRFS encrypted and I manually selected the partition type BTRFS encrypted once the array was stopped. One things changed, both disk3 and 4 before restarting the array had an orange lock saying it will be encrypted. But result is still the same after restarting the array.

 

image.thumb.png.9da5c05c5a453e51d308adf9cb4ab4a6.png

 

cerebro-diagnostics-20191216-1622.zip

Edited by Cererbo

  • Community Expert

Why are you doing new configs? That won't help with the problem and if don't know what you're doing you can make it worse.

 

Before disks 3 and 4 were showing as no valid file system, because Unraid wasn't trying to decrypt them, e.g., for disk3.

Dec 16 17:15:07 Cerebro emhttpd: shcmd (1072): mkdir -p /mnt/disk3
Dec 16 17:15:07 Cerebro emhttpd: shcmd (1073): mount -t btrfs,xfs,reiserfs -o noatime,nodiratime /dev/md3 /mnt/disk3
Dec 16 17:15:07 Cerebro root: mount: /mnt/disk3: wrong fs type, bad option, bad superblock on /dev/md3, missing codepage or helper program, or other error.
Dec 16 17:15:07 Cerebro emhttpd: shcmd (1073): exit status: 32
Dec 16 17:15:07 Cerebro emhttpd: /mnt/disk3 mount error: No file system
Dec 16 17:15:07 Cerebro emhttpd: shcmd (1074): umount /mnt/disk3
Dec 16 17:15:07 Cerebro root: umount: /mnt/disk3: not mounted.
Dec 16 17:15:07 Cerebro emhttpd: shcmd (1074): exit status: 32
Dec 16 17:15:07 Cerebro emhttpd: shcmd (1075): rmdir /mnt/disk3

Now after changing the filesystem to encrypted I see wrong key error:

Dec 16 17:19:12 Cerebro emhttpd: shcmd (1436): mkdir -p /mnt/disk3
Dec 16 17:19:12 Cerebro emhttpd: /mnt/disk3 mount error: Wrong encryption key
Dec 16 17:19:12 Cerebro emhttpd: shcmd (1437): umount /mnt/disk3
Dec 16 17:19:12 Cerebro root: umount: /mnt/disk3: not mounted.

 

Which would suggest the key really is wrong, I guess that could happen if after a new config you entered a new key that is the same used in disk2 but note the one used in disks 3 and 4, but since I don't use encryption and not really familiar with how it works I'll leave it to see if someone else has any ideas.

  • Author

OK but I'm 100% sure i used the same passphrase for all disks. Maybe there is a way to remove the encryption to access the data?

I did a new config because otherwise I can't start the array at all.

But You're maybe right I should leave it as is now and hopefully someone can solve the issue.

  • Author

when i try to mount one of the locked drive as  unassigned I get this log:

 

Dec 16 19:08:50 Cerebro emhttpd: shcmd (1163): /usr/sbin/cryptsetup luksOpen /dev/sdf1 ST10000VN0008-2JJ101_ZHZ4E1EV --allow-discards --key-file=-
Dec 16 19:08:52 Cerebro emhttpd: emhttpd: HTTP/1.1 500 Internal Server Error#015
Dec 16 19:08:52 Cerebro unassigned.devices: luksOpen error: 500 Internal Server Error
Dec 16 19:08:52 Cerebro unassigned.devices: Partition 'ST10000VN0008-2JJ101_ZHZ4E1EV' could not be mounted.

  • Community Expert
2 hours ago, Cererbo said:

Maybe there is a way to remove the encryption to access the data?

Wouldn't that make encrypting disks kind of pointless?

 

2 hours ago, Cererbo said:

OK but I'm 100% sure i used the same passphrase for all disks.

The only way this issue makes sense to me is if disks 3 and 4 really are using a different key than disk2, I can't see how it can be an Unraid problem if the key works on disk2 and is reported as wrong for the other disks, but like mentioned I don't use encryption, so can't be 100% sure.

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.