Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Terminal] How do I obtain the sdX for the parity disk?

Featured Replies

I like to know if the Parity Disk is sleeping. The command would be:

smartctl -n standby /dev/sdX

But how do I obtain the sdX of the (first) parity disk?

 

lsblk does not return the correlation between sdX and mdX:

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0   9.1M  1 loop /lib/modules
loop1         7:1    0   7.1M  1 loop /lib/firmware
loop2         7:2    0    20G  0 loop /var/lib/docker
sda           8:0    0  10.9T  0 disk 
└─sda1        8:1    0  10.9T  0 part 
sdb           8:16   0  10.9T  0 disk 
└─sdb1        8:17   0  10.9T  0 part 
sdc           8:32   1  14.2G  0 disk 
└─sdc1        8:33   1  14.2G  0 part /boot
sdd           8:48   0  10.9T  0 disk 
└─sdd1        8:49   0  10.9T  0 part 
sde           8:64   0  10.9T  0 disk 
└─sde1        8:65   0  10.9T  0 part 
sdf           8:80   0  10.9T  0 disk 
└─sdf1        8:81   0  10.9T  0 part 
sdg           8:96   0  10.9T  0 disk 
└─sdg1        8:97   0  10.9T  0 part 
sdh           8:112  0  10.9T  0 disk 
└─sdh1        8:113  0  10.9T  0 part 
sdi           8:128  0  10.9T  0 disk 
└─sdi1        8:129  0  10.9T  0 part 
sdj           8:144  0  10.9T  0 disk 
└─sdj1        8:145  0  10.9T  0 part 
sdk           8:160  0  10.9T  0 disk 
└─sdk1        8:161  0  10.9T  0 part 
md1           9:1    0  10.9T  0 md   /mnt/disk1
md2           9:2    0  10.9T  0 md   /mnt/disk2
md3           9:3    0  10.9T  0 md   /mnt/disk3
md4           9:4    0  10.9T  0 md   /mnt/disk4
md5           9:5    0  10.9T  0 md   /mnt/disk5
md6           9:6    0  10.9T  0 md   /mnt/disk6
md7           9:7    0  10.9T  0 md   /mnt/disk7
md8           9:8    0  10.9T  0 md   /mnt/disk8
md9           9:9    0  10.9T  0 md   /mnt/disk9
nvme0n1     259:0    0 931.5G  0 disk 
└─nvme0n1p1 259:1    0 931.5G  0 part /mnt/cache

 

  • Community Expert

Search for    disk0     in the syslog

  • Author

I meant through a command. I mean I could filter the syslog, but is this the only solution?

  • Community Expert

Why are you so insistent to find it through the use of the command line?  You could easily grab it from the GUI.  (Just look for it on the Main page..)  Once the assignment is make during boot-up, it will never change. 

 

Point of disclosure:  It has been forty years since I last did much Unix(Linux) command line work and I don't remember enough of it to even begin to start to construct an expression to extract that information from the syslog.  The starting point would probably be the use of grep...

  • Community Expert
41 minutes ago, mgutt said:

I meant through a command. I mean I could filter the syslog, but is this the only solution?

Why do you even want to use the sdX type name as that is subject to change at any time if you reboot (as the sdX names are assigned dynamically by Linux during the boot process).   Is it possible for your use case to use one of the names that show up under the /dev/disk hierarchy as these should be invariant.

  • Author
7 minutes ago, itimpi said:

Why do you even want to use the sdX type name

If you are interested:

https://forums.unraid.net/topic/98033-xfs-extended-defragmentation/

 

Solved it as follows:

parity_id=$(mdcmd status | grep rdevName.0 | cut -d = -f 2)
echo "Parity has device id $parity_id"
parity_state=$(smartctl -n standby "/dev/$parity_id")

 

Edited by mgutt

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.