Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-35980

[RHEL10] format second partition failed with hw-opal

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • rhel-10.0.beta
    • cryptsetup
    • None
    • sst_logical_storage
    • ssg_platform_storage
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None

      What were you trying to do that didn't work?

      Please provide the package NVR for which bug is seen:

      How reproducible:

      Steps to reproduce

      1.  
      2.  
      3.  

      Expected results

      Actual results

       

       

      echo -e LV74WMVEUK76GZSCF4UVQDKGG49TS5GL | cryptsetup  erase /dev/nvme0n1   -q  --hw-opal-factory-reset
      
      [root@storageqe-66 cryptsetup_libblockdev]# fdisk /dev/nvme0n1 Welcome to fdisk (util-linux 2.40-rc1).
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.Device does not contain a recognized partition table.
      Created a new DOS (MBR) disklabel with disk identifier 0x4c0588eb.Command (m for help): n
      Partition type
         p   primary (0 primary, 0 extended, 4 free)
         e   extended (container for logical partitions)
      Select (default p): Using default response p.
      Partition number (1-4, default 1): 
      First sector (256-390703445, default 256): 
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (256-390703445, default 390703445): +5GCreated a new partition 1 of type 'Linux' and of size 5 GiB.Command (m for help): n
      Partition type
         p   primary (1 primary, 0 extended, 3 free)
         e   extended (container for logical partitions)
      Select (default p): Using default response p.
      Partition number (2-4, default 2): 
      First sector (1310976-390703445, default 1310976): 
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (1310976-390703445, default 390703445): +10GCreated a new partition 2 of type 'Linux' and of size 10 GiB.Command (m for help): w
      The partition table has been altered.
      Calling ioctl() to re-read partition table.
      Syncing disks.
      
      nvme0n1                     259:1    0   1.5T  0 disk 
      ├─nvme0n1p1                 259:2    0     5G  0 part 
      └─nvme0n1p2                 259:3    0    10G  0 part 
      nvme1n1                     259:5    0     5G  0 disk 
      [root@storageqe-66 cryptsetup_libblockdev]# cryptsetup luksFormat /dev/nvme0n1p1 --hw-opal -q
      Enter passphrase for /dev/nvme0n1p1: 
      Enter OPAL Admin password: 
      [root@storageqe-66 cryptsetup_libblockdev]# cryptsetup luksFormat /dev/nvme0n1p2 --hw-opal -q
      Enter passphrase for /dev/nvme0n1p2: 
      Enter OPAL Admin password: 
      Device /dev/nvme0n1p2 is too small.
      [root@storageqe-66 cryptsetup_libblockdev]# uname -a
      Linux storageqe-66.rhts.eng.pek2.redhat.com 6.9.0-rc7.local #1 SMP PREEMPT_DYNAMIC Wed May  8 08:39:33 EDT 2024 x86_64 GNU/Linux
      [root@storageqe-66 cryptsetup_libblockdev]# 
      [root@storageqe-66 cryptsetup_libblockdev]# cryptsetup luksFormat /dev/nvme0n1p2 --hw-opal -q --debug
      # cryptsetup 2.7.2 processing "cryptsetup luksFormat /dev/nvme0n1p2 --hw-opal -q --debug"
      # Verifying parameters for command luksFormat.
      # Running command luksFormat.
      # Installing SIGINT/SIGTERM handler.
      # Unblocking interruption on signal.
      # Allocating context for crypt device /dev/nvme0n1p2.
      # Trying to open and read device /dev/nvme0n1p2 with direct-io.
      # Trying to open device /dev/nvme0n1p2 without direct-io.
      # Initialising device-mapper backend library.
      # Blkid check (filter none).
      # Interactive passphrase entry requested.
      Enter passphrase for /dev/nvme0n1p2: 
      # Checking new password using default pwquality settings.
      # Interactive passphrase entry requested.
      Enter OPAL Admin password: 
      # Checking new password using default pwquality settings.
      # Crypto backend (OpenSSL 3.2.1 30 Jan 2024 [default][legacy][threads][argon2]) initialized in cryptsetup library version 2.7.2.
      # Detected kernel Linux 6.9.0-rc7.local x86_64.
      # PBKDF argon2id, time_ms 2000 (iterations 0), max_memory_kb 1048576, parallel_threads 4.
      # Formatting device /dev/nvme0n1p2 as type LUKS2 with OPAL HW encryption.
      # OPAL GET_STATUS: flags:79
      # Reusing open ro fd on device /dev/nvme0n1p2
      # OPAL GET_GEOMETRY: align:1, lb_size:512, gran:16, lowest_lba:0
      # OPAL geometry: alignment: 'y', logical block size: 512, alignment granularity: 16, lowest aligned LBA: 0
      # OPAL alignment (512/16), offset = 0. Required alignment is 1048576.
      # Auto-detected optimal encryption sector size for device /dev/nvme0n1p2 is 4096 bytes.
      # Checking if cipher aes-xts-plain64 is usable.
      # Using userspace crypto wrapper to access keyslot area.
      # Reusing open ro fd on device /dev/nvme0n1p2
      Device /dev/nvme0n1p2 is too small.
      # Releasing crypt device /dev/nvme0n1p2 context.
      # Releasing device-mapper backend.
      # Closing read only fd for /dev/nvme0n1p2.
      Command failed with code -1 (wrong or missing parameters).
                  
      [root@storageqe-66 cryptsetup_libblockdev]# grep -rn OPAL /boot/config-6.9.0-rc7.local 
      1009:CONFIG_BLK_SED_OPAL=y
      [root@storageqe-66 cryptsetup_libblockdev]# 
       

      libblkid-2.40-0.8.rc1.el10.x86_64

      [root@storageqe-66 cryptsetup_libblockdev]# cryptsetup --version
      cryptsetup 2.7.2 flags: UDEV BLKID KEYRING FIPS KERNEL_CAPI PWQUALITY HW_OPAL 
      [root@storageqe-66 cryptsetup_libblockdev]

       

            okozina@redhat.com Ondrej Kozina
            guazhang@redhat.com Guangwu Zhang
            Ondrej Kozina Ondrej Kozina
            Guangwu Zhang Guangwu Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: