Package: util-linux Version: 2.39.1-4 Severity: normal Tags: upstream
-- System Information: Debian Release: trixie/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 6.4.0-2-amd64 (SMP w/20 CPU threads; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages util-linux depends on: ii libblkid1 2.39.1-4 ii libc6 2.37-7 ii libcap-ng0 0.8.3-1+b3 ii libcrypt1 1:4.4.36-2 ii libmount1 2.39.1-4 ii libpam0g 1.5.2-7 ii libselinux1 3.5-1 ii libsmartcols1 2.39.1-4 ii libsystemd0 254.1-2 ii libtinfo6 6.4+20230625-2 ii libudev1 254.1-2 ii libuuid1 2.39.1-4 ii zlib1g 1:1.2.13.dfsg-1 Versions of packages util-linux recommends: ii sensible-utils 0.0.20 Versions of packages util-linux suggests: ii dosfstools 4.2-1 ii kbd 2.5.1-1+b1 ii util-linux-extra 2.39.1-4 ii util-linux-locales 2.39.1-4 -- no debconf information Two block devices are repotred on the same line when using the -M option. On this system I have raid1 from IMSM, with partition 4 as a LVM PV, and 4 LV. These lines should have been split into 2 lines: ┆ └─mir-home 253:3 0 256G 0 lvm /home ├┈┈md126 9:126 0 2.5T 0 raid0 ┆ └─stp-deb32 253:5 0 128G 0 lvm /backup/deb32 └┈┈md127 9:127 0 0B 0 md Running following script detalis my configuration: ---------- set -x sudo mdadm --detail-platform sudo mdadm --detail /dev/md/* lsblk echo Show formatting error and trailing spaces lsblk -M | sed 's/$/\$/' # show trailing spaces # Expected output for demonstration (specific to my configuration) echo Show desired output using 'sed' to insert missing line breaks lsblk -M | sed 's|/home |/home\n |;s|/deb32 |/deb32\n |' ---------- Running this script results in the following output: ---------- + sudo mdadm --detail-platform Platform : Intel(R) Rapid Storage Technology Version : 19.5.0.5676 RAID Levels : raid0 raid1 raid10 raid5 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : supported Max Disks : 32 Max Volumes : 2 per array, 4 per controller I/O Controller : /sys/devices/pci0000:00/0000:00:0e.0/pci10000:e0/10000:e0:17.0 (SATA VMD) Port5 : /dev/sdb (WD-WMAL91264840) Port4 : /dev/sda (WD-WMAL91409154) Port0 : - no device attached - Port1 : - no device attached - Port2 : - no device attached - Port3 : - no device attached - Port6 : - no device attached - Port7 : - no device attached - Platform : Intel(R) Rapid Storage Technology Version : 19.5.0.5676 RAID Levels : raid0 raid1 raid10 raid5 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : supported Max Disks : 32 Max Volumes : 2 per array, 4 per controller 3rd party NVMe : supported I/O Controller : /sys/devices/pci0000:00/0000:00:0e.0 (VMD) NVMe under VMD : /dev/nvme0n1 (S69ENX0W636622Z) NVMe under VMD : /dev/nvme1n1 (S69ENX0W636630X) + sudo mdadm --detail /dev/md/ARRAY /dev/md/ARRAY1 /dev/md/ARRAY2 /dev/md/ARRAY3 /dev/md/imsm0 /dev/md/imsm1 /dev/md/Volume1 /dev/md/Volume1p1 /dev/md/Volume1p2 /dev/md/Volume1p3 /dev/md/Volume1p4 /dev/md/Volume2 /dev/md/ARRAY: Container : /dev/md/imsm1, member 0 Raid Level : raid1 Array Size : 156249600 (149.01 GiB 160.00 GB) Used Dev Size : 156249600 (149.01 GiB 160.00 GB) Raid Devices : 2 Total Devices : 2 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 9d8d362d:532d8976:87b0e4e2:5da4745f Number Major Minor RaidDevice State 1 8 0 0 active sync /dev/sda 0 8 16 1 active sync /dev/sdb /dev/md/ARRAY1: Container : /dev/md/imsm1, member 0 Raid Level : raid1 Array Size : 72261 (70.57 MiB 74.00 MB) Used Dev Size : 156249600 (149.01 GiB 160.00 GB) Raid Devices : 2 Total Devices : 2 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 9d8d362d:532d8976:87b0e4e2:5da4745f Number Major Minor RaidDevice State 1 8 0 0 active sync /dev/sda 0 8 16 1 active sync /dev/sdb /dev/md/ARRAY2: Container : /dev/md/imsm1, member 0 Raid Level : raid1 Array Size : 152505045 (145.44 GiB 156.17 GB) Used Dev Size : 156249600 (149.01 GiB 160.00 GB) Raid Devices : 2 Total Devices : 2 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 9d8d362d:532d8976:87b0e4e2:5da4745f Number Major Minor RaidDevice State 1 8 0 0 active sync /dev/sda 0 8 16 1 active sync /dev/sdb /dev/md/ARRAY3: Container : /dev/md/imsm1, member 0 Raid Level : raid1 Array Size : 3670852 (3.50 GiB 3.76 GB) Used Dev Size : 156249600 (149.01 GiB 160.00 GB) Raid Devices : 2 Total Devices : 2 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 9d8d362d:532d8976:87b0e4e2:5da4745f Number Major Minor RaidDevice State 1 8 0 0 active sync /dev/sda 0 8 16 1 active sync /dev/sdb /dev/md/imsm0: Version : imsm Raid Level : container Total Devices : 2 Working Devices : 2 UUID : 2d53d996:4e2c799f:1827f725:d8995952 Member Arrays : /dev/md/Volume1 /dev/md/Volume2 Number Major Minor RaidDevice - 259 5 - /dev/nvme1n1 - 259 0 - /dev/nvme0n1 /dev/md/imsm1: Version : imsm Raid Level : container Total Devices : 2 Working Devices : 2 UUID : 800266cb:4d25f476:d260b0c7:465a2cee Member Arrays : /dev/md/ARRAY Number Major Minor RaidDevice - 8 0 - /dev/sda - 8 16 - /dev/sdb /dev/md/Volume1: Container : /dev/md/imsm0, member 0 Raid Level : raid1 Array Size : 614400000 (585.94 GiB 629.15 GB) Used Dev Size : 614400000 (585.94 GiB 629.15 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 22e98099:745d9b7f:ce7f5822:b052190a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 /dev/md/Volume1p1: Container : /dev/md/imsm0, member 0 Raid Level : raid1 Array Size : 1024 Used Dev Size : 614400000 (585.94 GiB 629.15 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 22e98099:745d9b7f:ce7f5822:b052190a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 /dev/md/Volume1p2: Container : /dev/md/imsm0, member 0 Raid Level : raid1 Array Size : 1048576 (1024.00 MiB 1073.74 MB) Used Dev Size : 614400000 (585.94 GiB 629.15 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 22e98099:745d9b7f:ce7f5822:b052190a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 /dev/md/Volume1p3: Container : /dev/md/imsm0, member 0 Raid Level : raid1 Array Size : 1048576 (1024.00 MiB 1073.74 MB) Used Dev Size : 614400000 (585.94 GiB 629.15 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 22e98099:745d9b7f:ce7f5822:b052190a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 /dev/md/Volume1p4: Container : /dev/md/imsm0, member 0 Raid Level : raid1 Array Size : 612299776 (583.93 GiB 626.99 GB) Used Dev Size : 614400000 (585.94 GiB 629.15 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 22e98099:745d9b7f:ce7f5822:b052190a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 /dev/md/Volume2: Container : /dev/md/imsm0, member 1 Raid Level : raid0 Array Size : 2678219776 (2.49 TiB 2.74 TB) Raid Devices : 2 Total Devices : 2 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Chunk Size : 64K Consistency Policy : none UUID : fd10b6a3:681ea35e:b6a053df:c74767e7 Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 5 1 active sync /dev/nvme1n1 + lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 149G 0 disk ├─md123 9:123 0 149G 0 raid1 │ ├─md123p1 259:6 0 70.6M 0 part │ ├─md123p2 259:7 0 145.4G 0 part │ └─md123p3 259:8 0 3.5G 0 part └─md124 9:124 0 0B 0 md sdb 8:16 0 149G 0 disk ├─md123 9:123 0 149G 0 raid1 │ ├─md123p1 259:6 0 70.6M 0 part │ ├─md123p2 259:7 0 145.4G 0 part │ └─md123p3 259:8 0 3.5G 0 part └─md124 9:124 0 0B 0 md nvme0n1 259:0 0 1.8T 0 disk ├─md125 9:125 0 585.9G 0 raid1 │ ├─md125p1 259:1 0 1M 0 part │ ├─md125p2 259:2 0 1G 0 part /boot/efi │ ├─md125p3 259:3 0 1G 0 part /boot │ └─md125p4 259:4 0 583.9G 0 part │ ├─mir-root 253:0 0 64G 0 lvm / │ ├─mir-var 253:1 0 32G 0 lvm /var │ ├─mir-swap 253:2 0 128G 0 lvm [SWAP] │ └─mir-home 253:3 0 256G 0 lvm /home ├─md126 9:126 0 2.5T 0 raid0 │ ├─stp-black 253:4 0 256G 0 lvm /backup/black │ └─stp-deb32 253:5 0 128G 0 lvm /backup/deb32 └─md127 9:127 0 0B 0 md nvme1n1 259:5 0 1.8T 0 disk ├─md125 9:125 0 585.9G 0 raid1 │ ├─md125p1 259:1 0 1M 0 part │ ├─md125p2 259:2 0 1G 0 part /boot/efi │ ├─md125p3 259:3 0 1G 0 part /boot │ └─md125p4 259:4 0 583.9G 0 part │ ├─mir-root 253:0 0 64G 0 lvm / │ ├─mir-var 253:1 0 32G 0 lvm /var │ ├─mir-swap 253:2 0 128G 0 lvm [SWAP] │ └─mir-home 253:3 0 256G 0 lvm /home ├─md126 9:126 0 2.5T 0 raid0 │ ├─stp-black 253:4 0 256G 0 lvm /backup/black │ └─stp-deb32 253:5 0 128G 0 lvm /backup/deb32 └─md127 9:127 0 0B 0 md + echo Show formatting error and trailing spaces Show formatting error and trailing spaces + lsblk -M + sed 's/$/\$/' NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS$ ┌┈▶ sda 8:0 0 149G 0 disk $ └┬▶ sdb 8:16 0 149G 0 disk $ ├┈┈md123 9:123 0 149G 0 raid1 $ ┆ ├─md123p1 259:6 0 70.6M 0 part $ ┆ ├─md123p2 259:7 0 145.4G 0 part $ ┆ └─md123p3 259:8 0 3.5G 0 part $ └┈┈md124 9:124 0 0B 0 md $ ┌┈▶ nvme0n1 259:0 0 1.8T 0 disk $ └┬▶ nvme1n1 259:5 0 1.8T 0 disk $ ├┈┈md125 9:125 0 585.9G 0 raid1 $ ┆ ├─md125p1 259:1 0 1M 0 part $ ┆ ├─md125p2 259:2 0 1G 0 part /boot/efi$ ┆ ├─md125p3 259:3 0 1G 0 part /boot$ ┆ └─md125p4 259:4 0 583.9G 0 part $ ┆ ├─mir-root 253:0 0 64G 0 lvm /$ ┆ ├─mir-var 253:1 0 32G 0 lvm /var$ ┆ ├─mir-swap 253:2 0 128G 0 lvm [SWAP]$ ┆ └─mir-home 253:3 0 256G 0 lvm /home ├┈┈md126 9:126 0 2.5T 0 raid0 $ ┆ ├─stp-black 253:4 0 256G 0 lvm /backup/black$ ┆ └─stp-deb32 253:5 0 128G 0 lvm /backup/deb32 └┈┈md127 9:127 0 0B 0 md $ + echo Show desired output using sed to insert missing line breaks Show desired output using sed to insert missing line breaks + lsblk -M + sed 's|/home |/home\n |;s|/deb32 |/deb32\n |' NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS ┌┈▶ sda 8:0 0 149G 0 disk └┬▶ sdb 8:16 0 149G 0 disk ├┈┈md123 9:123 0 149G 0 raid1 ┆ ├─md123p1 259:6 0 70.6M 0 part ┆ ├─md123p2 259:7 0 145.4G 0 part ┆ └─md123p3 259:8 0 3.5G 0 part └┈┈md124 9:124 0 0B 0 md ┌┈▶ nvme0n1 259:0 0 1.8T 0 disk └┬▶ nvme1n1 259:5 0 1.8T 0 disk ├┈┈md125 9:125 0 585.9G 0 raid1 ┆ ├─md125p1 259:1 0 1M 0 part ┆ ├─md125p2 259:2 0 1G 0 part /boot/efi ┆ ├─md125p3 259:3 0 1G 0 part /boot ┆ └─md125p4 259:4 0 583.9G 0 part ┆ ├─mir-root 253:0 0 64G 0 lvm / ┆ ├─mir-var 253:1 0 32G 0 lvm /var ┆ ├─mir-swap 253:2 0 128G 0 lvm [SWAP] ┆ └─mir-home 253:3 0 256G 0 lvm /home ├┈┈md126 9:126 0 2.5T 0 raid0 ┆ ├─stp-black 253:4 0 256G 0 lvm /backup/black ┆ └─stp-deb32 253:5 0 128G 0 lvm /backup/deb32 └┈┈md127 9:127 0 0B 0 md ---------- Thanks, Matthijs Melchior.