logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: 9f4bccd3e2469a3d98ee09b20e378befe37c0bbe
parent c9712ff2ff861bc5ece81ddd4abc8e0c40d9994b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 25 May 2020 15:38:04 +0200

Disk identification: kbd+samp

Diffstat:

Marticles/Disk identification.xhtml10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/articles/Disk identification.xhtml b/articles/Disk identification.xhtml @@ -3,8 +3,8 @@ <h2>Introduction/Why?</h2> <p>So the one for network interface is now okay-ish. I done a quick look at how it works for… disks. So most of it was done under Linux, but I know this nightmare under OpenSolaris(I recommend <a href="http://sysunconfig.net/unixtips/solaris80.20.pdf">20% of Solaris Knowledge that solves 80% of your needs</a>; but only 8 slices/partitions, non-intuitive, no file hierarchy… why), Plan9front(a bit better, at least partitions are under a directory).</p> <p>And as you’re probably using <code>lsblk</code> and/or <code>blkid</code> or even <code>fdisk -l</code>(I use that when I’m on a non-Linux Unix) to identify as a human your disks, I done a quick look for fun at disk identifiers… (intended more for machines I guess) and… oh noes.</p> -<pre><code>$ lsblk -oTRAN,NAME,SIZE,FSTYPE,PARTUUID,UUID,WWN -TRAN NAME SIZE FSTYPE PARTUUID UUID WWN +<pre><code>$ <kbd>lsblk -oTRAN,NAME,SIZE,FSTYPE,PARTUUID,UUID,WWN</kbd> +<samp>TRAN NAME SIZE FSTYPE PARTUUID UUID WWN usb sdf 2G └─sdf1 2G vfat usb sdd 931.5G @@ -20,8 +20,8 @@ sata sda 189.9G ├─sda3 248M crypto_LUKS d4d61264-c2c9-4953-8c59-3ac265d986e3 9877c105-252e-4141-97df-358f14daa2a8 └─sda1 189.4G crypto_LUKS a359857c-49eb-44c0-936c-464c150d20a0 1c578f43-6f16-497c-ba88-986609ffa1d6 └─root 189.4G -$ blkid -/dev/sda1: UUID="1c578f43-6f16-497c-ba88-986609ffa1d6" TYPE="crypto_LUKS" PARTLABEL="encrypted" PARTUUID="a359857c-49eb-44c0-936c-464c150d20a0" +</samp>$ <kbd>blkid</kbd> +<samp>/dev/sda1: UUID="1c578f43-6f16-497c-ba88-986609ffa1d6" TYPE="crypto_LUKS" PARTLABEL="encrypted" PARTUUID="a359857c-49eb-44c0-936c-464c150d20a0" /dev/sda3: UUID="9877c105-252e-4141-97df-358f14daa2a8" TYPE="crypto_LUKS" PARTLABEL="boot-efi" PARTUUID="d4d61264-c2c9-4953-8c59-3ac265d986e3" /dev/sdb: LABEL="seagate" UUID="15625953673200575561" UUID_SUB="11105316071247026470" TYPE="zfs_member" /dev/sdc2: UUID="86106360-90e8-425e-b37e-33131b23a6b0" TYPE="crypto_LUKS" PARTUUID="caadf50b-7419-4379-b34e-6cbdb9fb9e17" @@ -32,7 +32,7 @@ $ blkid /dev/sda2: PARTLABEL="boot" PARTUUID="b585598d-8b2c-4db8-b58c-65bfe314d57e" /dev/sdc1: PARTUUID="d3e52e3c-2c83-48e5-af2f-8c3ce10131aa" /dev/sdf1: SEC_TYPE="msdos" TYPE="vfat" -</code></pre> +</samp></code></pre> <p>If you look enough at it… NONE of them works and wtf is <code>UUID_SUB</code> printing out of nowhere. So as you’re probably not <code>LABEL</code>’ing all your hard-drives because your system sucks… The only thing I found so far that is the least broken under linux(+(e)udev) is <code>/dev/disk/by-id</code>.</p> <h2>Proposition</h2> <p>So quick list of things that are nice/works:</p>