Very weird problem

  1. Set up ZFS L2ARC cache drive:

Plug in the external drive. In my case, the device shows in the Disks application as /dev/sdb1. You'll need to note the device path for later. In the Disks application, click the '-' button on the drive you want, to erase the partition(s). Then exit the Disks application.

If you don't already have gdisk:

sudo apt install gdisk

In Terminal, type:

sudo gdisk

That starts up a child process. Type ? to see the options available.

We want to type the o option (create a new empty GUID partition table (GPT)), then confirm the action.

Then we want the w option (write table to disk and exit), then confirm the action.

You should see something like:
OK; writing new GUID partition table (GPT) to /dev/sdb1.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8)
The operation has completed successfully.

Now we've got a GPT partition table on the drive. Now you'll have to reboot.

Once Zorin OS has booted, open terminal, and type:

sudo gdisk

The child process starts in Terminal. Now type p to print the partition table.

Disk /dev/sdb1: 62330880 sectors, 29.7 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 168CC26E-54C1-4F9D-98F0-92227F45620B
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 62330846
Partitions will be aligned on 2048-sector boundaries
Total free space is 62330813 sectors (29.7 GiB)

Then type v to verify the disk. You should see "No problems found."

Intestingly, if I type sudo gdisk and enter /dev/sda1 (the internal drive), I get:


Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!


That's the GPT layout and ZFS file system that the Zorin OS installation created. So ZFS isn't quite ready for prime-time in this OS. Here's hoping the devs have a way of converting the disk to a valid GPT layout without requiring a reinstall.

Anyway, now we want to get the disk ID:

sudo ls -al /dev/disk/by-id
[sudo] password for owner:
total 0
drwxr-xr-x 2 root root 360 Nov 28 18:09 .
drwxr-xr-x 8 root root 160 Nov 28 18:09 ..
lrwxrwxrwx 1 root root 9 Nov 28 18:09 ata-TOSHIBA_MK6475GSX_X1JGT6RIT -> ../../sda
lrwxrwxrwx 1 root root 10 Nov 28 18:10 ata-TOSHIBA_MK6475GSX_X1JGT6RIT-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov 28 18:09 ata-TOSHIBA_MK6475GSX_X1JGT6RIT-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov 28 18:09 ata-TOSHIBA_MK6475GSX_X1JGT6RIT-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Nov 28 18:09 ata-TOSHIBA_MK6475GSX_X1JGT6RIT-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Nov 28 18:10 ata-TOSHIBA_MK6475GSX_X1JGT6RIT-part7 -> ../../sda7
lrwxrwxrwx 1 root root 9 Nov 28 18:09 ata-TSSTcorp_DVD+_-RW_SN-208BB_R8KL6GIB946979 -> ../../sr0
lrwxrwxrwx 1 root root 9 Nov 28 18:09 usb-Generic-_Multi-Card_20090516388200000-0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Nov 28 18:09 usb-Generic-_Multi-Card_20090516388200000-0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov 28 18:09 usb-Generic-_Multi-Card_20090516388200000-0:0-part9 -> ../../sdb9
lrwxrwxrwx 1 root root 9 Nov 28 18:09 wwn-0x50000393917859cb -> ../../sda
lrwxrwxrwx 1 root root 10 Nov 28 18:10 wwn-0x50000393917859cb-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov 28 18:09 wwn-0x50000393917859cb-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov 28 18:09 wwn-0x50000393917859cb-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Nov 28 18:09 wwn-0x50000393917859cb-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Nov 28 18:10 wwn-0x50000393917859cb-part7 -> ../../sda7

So my target disk ID is usb-Generic-_Multi-Card_20090516388200000-0:0-part1

Now we can set up that drive as a cache drive on the rpool:

sudo zpool add rpool cache usb-Generic-_Multi-Card_20090516388200000-0:0-part1

And finally, we check the status:

sudo zpool status
pool: bpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:00:12 with 0 errors on Mon Nov 28 17:11:55 2022
config:

NAME           STATE     READ WRITE CKSUM
bpool          ONLINE       0     0     0
  ed10adf2-06  ONLINE       0     0     0

errors: No known data errors

pool: rpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:02:35 with 0 errors on Mon Nov 28 17:14:29 2022
config:

NAME                                                   STATE     READ WRITE CKSUM
rpool                                                  ONLINE       0     0     0
  ed10adf2-07                                          ONLINE       0     0     0
cache
  usb-Generic-_Multi-Card_20090516388200000-0:0-part1  ONLINE       0     0     0

errors: No known data errors

Issued Terminal commands:
sudo zpool scrub bpool
sudo zpool scrub rpool

-- reboot --

1 Like