weird media names in pool status

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

weird media names in pool status

Postby rpammeraal » Sun Nov 22, 2015 4:33 pm

Hi,

Created a zpool, but when I do a pool status I get media-<UUID> names instead of /dev/diskX.
For example:
Code: Select all
   NAME                                            STATE     READ WRITE CKSUM
   sunDATA                                         DEGRADED     0     0     0
     raidz2-0                                      DEGRADED     0     0     0
       media-01BDA9AD-E4D4-7B43-9BD3-229060FED274  ONLINE       0     0     0
       media-51539492-A269-E543-9642-20F5218F9522  ONLINE       0     0     0


Story behind is that I want to replace a drive, but using this media-<UUID> in the pool replace command yields an:

Code: Select all
cannot replace media-C94AA69D-4DBA-AA48-9F1F-D4A669AC4DB5 with /dev/disk12: no such device in pool


Any advice is much appreciated!

Roy
rpammeraal
 
Posts: 5
Joined: Sun Nov 22, 2015 4:30 pm

Re: weird media names in pool status

Postby ilovezfs » Sun Nov 22, 2015 4:44 pm

sudo zpool export sunDATA
sudo zpool import -d /dev sunDATA
sudo zpool replace ...
sudo zpool export sunDATA
sudo zpool import -d /private/var/run/disk/by-id sunDATA
ilovezfs
 
Posts: 229
Joined: Thu Mar 06, 2014 7:58 am

Re: weird media names in pool status

Postby ilovezfs » Sun Nov 22, 2015 6:44 pm

ilovezfs
 
Posts: 229
Joined: Thu Mar 06, 2014 7:58 am

Re: weird media names in pool status

Postby rottegift » Mon Nov 23, 2015 6:28 pm

I think you can skip some exporting and importing.

Make note of where in the output of zpool status -v your to-be-replaced device is.

Run zpool status -vg sunDATA

Make note of the to-be-replaced device's guid.

Know the device of your replacement disk, (diskXX).

Run ls -l /var/run/disk/by* | grep diskXX

Choose one of the matches.

Run sudo zpool replace sunDATA to-be-replaced-device-guid /var/run/disk/by-whatever/match
rottegift
 
Posts: 25
Joined: Fri Apr 25, 2014 12:00 am

Re: weird media names in pool status

Postby ilovezfs » Mon Nov 23, 2015 7:29 pm

It is of course just a bug, which this topic reminded me to fix: https://github.com/openzfsonosx/zfs/com ... 66291261e7

rottegift, yes the guids will work for replacement. However, the command you suggested is not possible if he's going to use the standard configuration of whole_disk=1 + by-id links, because the by-id links do not exist until the disk is partitioned, and the disk is not partitioned when whole_disk=1 until after create/replace/add/attach. Therefore, at least one export/import will be required. What you suggested will work, of course, if he's using by-serial or by-path links.

Also, assuming by-serial or by-path is the choice,

rottegift wrote:sudo zpool replace sunDATA to-be-replaced-device-guid /var/run/disk/by-whatever/match

can be simplified to

Code: Select all
sudo zpool replace sunDATA to-be-replaced-device-guid match
ilovezfs
 
Posts: 229
Joined: Thu Mar 06, 2014 7:58 am

Re: weird media names in pool status

Postby rpammeraal » Sun Jan 03, 2016 6:26 pm

Thanks for the replies -- I was able to replace drives now.
rpammeraal
 
Posts: 5
Joined: Sun Nov 22, 2015 4:30 pm


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 1 guest

cron