Check S.M.A.R.T. on external SSDs with USB-C

Ever came across this?

# smartctl -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.14.0-1008-oem] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdb: Unknown USB bridge [0x0781:0x558c (0x1012)]

You can try passing the -d sat parameter like this:

# smartctl -d sat -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.14.0-1008-oem] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     SanDisk SD9SN8W1T00
…

Don’t forget to check out the manpages for smartctl. It has a comprehensive list of options to pass.

cross-compiling to i386 using gcc 10

Ever had that issue on Ubuntu?

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a when searching for -lgcc

/usr/bin/ld: cannot find -lgcc

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a when searching for -lgcc

/usr/bin/ld: cannot find -lgcc 

Install the following:

  • gcc-10-multilib
  • g++-10-multilib (for C++)

Increase VM storage on-line

Increase from 300 G to 400 G using the same storage, but leverage LVM on GPT inside the VM.

Host:

lvextend -L +100G /dev/mapper/guests--lolguest
virsh qemu-monitor-command lolguest info block --hmp
virsh qemu-monitor-command lolguest block_resize drive-virtio-disk0 400G --hmp

VM:

sgdisk -e /dev/vda
gdisk /dev/vda # <-- create partition 5
partprobe /dev/vda
pvcreate /dev/vda5
vgextend ubuntu-vg /dev/vda5
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Always watch out for paths, partition numbers and names!