I bought an external SSD (2 Tera Byte), called “WD My Passport SSD 2TB Mobile SSD Storage”.
I am trying to encrypt with LUKS and format the storage device with BTRFS format on Fedora Linux 39. I referred to Fedora’s document[1], and my past article blog article about encrypting and encrypting with LUKS and formatting 1 TB HDD with BTRFS[2].
Then I got an error. Let me explain it.
As an initial state, the SSD was detected as /dev/sda1
with the label by the lsblk
command.
$ lsblk -r -p -o NAME,TYPE,FSTYPE,UUID,SIZE,LABEL
...
/dev/sda disk 1.8T
/dev/sda1 part exfat BAB8-C8F1 1.8T My\x20Passport
...
Following the [1], as preparation before formatting the SSD, I filled random data into the storage device.
$ sudo badblocks -c 10240 -s -w -t random -v /dev/sda1
Then, I formatted the storage device.
$ sudo cryptsetup luksFormat /dev/sda1
...
Are you sure? (Type 'yes' in capital letters): YES
Enter passphrase for /dev/sda1:
Verify passphrase:
...
Then, I created a mapping to allow access to the device’s decrypted contents.
$ sudo cryptsetup luksUUID /dev/sda1
c522db23-e751-4fa6-a9a6-a45dc06878fc
$ sudo cryptsetup luksOpen /dev/sda1 luks-c522db23-e751-4fa6-a9a6-a45dc06878fc
Below is the information about the mapped device.
$ sudo dmsetup info luks-c522db23-e751-4fa6-a9a6-a45dc06878fc
Name: luks-c522db23-e751-4fa6-a9a6-a45dc06878fc
State: ACTIVE
Read Ahead: 4096
Tables present: LIVE
Open count: 0
Event number: 0
Major, minor: 253, 1
Number of targets: 1
UUID: CRYPT-LUKS2-c522db23e7514fa6a9a6a45dc06878fc-luks-c522db23-e751-4fa6-a9a6-a45dc06878fc
Then I got the following error when trying to format the storage with BTRFS.
$ sudo mkfs.btrfs -L my-passport-ssd-2tb /dev/mapper/luks-c522db23-e751-4fa6-a9a6-a45dc06878fc
btrfs-progs v6.7.1
See https://btrfs.readthedocs.io for more information.
NOTE: several default settings have changed in version 5.15, please make sure
this does not affect your deployments:
- DUP for metadata (-m dup)
- enabled no-holes (-O no-holes)
- enabled free-space-tree (-R free-space-tree)
ERROR: error during mkfs: Operation not permitted
Now I noticed the /dev/sda
and /dev/sda1
lines disappeared in the output of the following lsblk
command.
$ lsblk -r -p -o NAME,TYPE,FSTYPE,UUID,SIZE,LABEL
Do you have any ideas about how to fix the error by the above mkfs.btrfs
command?
Thanks for your help!
- [1] Disk Encryption User Guide - Fedora Project Wiki
- [2] Encrypting and formatting HDD 1 Tera Byte with BTRFS: Fedora: Set up encriped disk with LUKS and btrfs format - Jun's Blog