Page 1 of 1

Different naming of disks in 'status' - How to fix?

PostPosted: Fri Oct 23, 2015 6:46 am
by RobRehnmark
So I'm running O3X 1.4.5 on El Capitan 10.11.1 but this "problem" have been with me for a long time now.
I would like all disks to show their serial numbers when checking status...
this way I could just put a sticker tag on each physical drive to identify them easily if one needs to be changed.

This is the way they show now:
Code: Select all
bash-3.2# zpool status
  pool: ocean
 state: ONLINE
  scan: scrub in progress since Fri Oct 23 15:05:49 2015
    1.64T scanned out of 9.50T at 409M/s, 5h35m to go
    0 repaired, 17.28% done
config:

   NAME                                            STATE     READ WRITE CKSUM
   ocean                                           ONLINE       0     0     0
     raidz2-0                                      ONLINE       0     0     0
       media-D66A118E-5447-8646-A572-A57FAAB83663  ONLINE       0     0     0
       media-36917999-BFAB-0742-B5A7-7152FBBB8F46  ONLINE       0     0     0
       media-BB8FDCE9-6092-6C43-9F67-AEC45EE604B8  ONLINE       0     0     0
       ST3000DM001-1ER166-Z5006B1D:1               ONLINE       0     0     0
       PCI0@0-IDE1@1F,2-PRT4@4-PMP@0-@0:1          ONLINE       0     0     0
       PCI0@0-IDE1@1F,2-PRT5@5-PMP@0-@0:1          ONLINE       0     0     0

errors: No known data errors


The disks are 6 x 3TB Seagate Barracuda ST3000DM001 hooked up to three different controllers (all on the motherboard.. yes, it's a hackintosh).
How can I make them all appear as the three first disks?

Thanks in advance for any help or advice.
Robert

Re: Different naming of disks in 'status' - How to fix?

PostPosted: Fri Oct 23, 2015 10:21 am
by ilovezfs

Re: Different naming of disks in 'status' - How to fix?

PostPosted: Fri Oct 23, 2015 11:13 am
by RobRehnmark
Ah! Awesome, thanks!
Will it stick between exports/imports, reboots, etc or do I have to do something to make it permanent?

Re: Different naming of disks in 'status' - How to fix?

PostPosted: Fri Oct 23, 2015 12:36 pm
by ilovezfs
Yes, it will stick unless at some point the import occurs after InvariantDisks' symlinks are there.

If you want an even safer setup, open /usr/local/libexec/zfs/launchd.d/zpool-import-all.sh and change the line that says import -a to instead be import -c /etc/zfs/zpool.cache -a

The zpool.cache will exist as long as you don't export the pool, which shouldn't be necessary unless you're moving the pool to another computer, but even then you can do import -f instead.

Re: Different naming of disks in 'status' - How to fix?

PostPosted: Fri Oct 23, 2015 1:59 pm
by RobRehnmark
Great, I'll set that up.
Thank you very much.

Re: Different naming of disks in 'status' - How to fix?

PostPosted: Tue Jul 19, 2016 12:31 am
by RobRehnmark
After exporting and updating to 1.5.2 on my hackintosh it reverted to showing disk by ID instead of SERIAL.

So I opened file /usr/local/libexec/zfs/launchd.d/zpool-import-all-sh
..and changed this line:
Code: Select all
"${ZPOOL}" import -a -d /var/run/disk/by-id

To:
Code: Select all
"${ZPOOL}" import -a -d /var/run/disk/by-serial


After rebooting it imported normally but the zpool status shows disk serial and this makes it easier and quicker to find the correct drive if I have to change one.