SGDISKMON(8)

πŸ“¦ version 1.6.6, in opensuse-leap 16.0

πŸ’… SGDISKMON(8) β€” like, the SCSI Generic RAID Monitor page, bestie

okay so this is the sgdiskmon page from the System Manager's Manual, and no cap it's a whole vibe. sit down, grab a strawberry drink πŸ“, we're learning about hot-swap today.


✨ NAME ✨

sgdiskmon β€” the SCSI Generic RAID Monitor πŸ‘‘


🌸 SYNOPSIS 🌸

sgdiskmon [-bermnx -t time]

πŸ¦‹ DESCRIPTION πŸ¦‹

So sgdiskmon is that girl who uses the SCSI Generic interface to keep an eye on SCSI devices that might be part of a software RAID. why? so hot-removal and hot-insertion events get detected and acted upon, periodt. πŸ’…

She also goes and queries the hot-swap backplane β€” if there even is one β€” using SAF-TE commands, to catch hot-insertions too. and when an insertion or removal event happens? she invokes a script: /sbin/mdevt. iconic behavior honestly.

What does mdevt do, you ask? for Insert, mdevt partitions the new disk and remirrors the Linux partitions. and the mdevt script can be customized however you want, it's your world 🫢.

⚠️ heads up bestie: the SCSI Generic interface requires that your kernel .config file has CONFIG_CHR_DEV_SG set. no CONFIG_CHR_DEV_SG, no slay.

Two log files get created, and yes they're different, don't @ me:

  • /var/log/sgdiskmon.log β€” logs the status of the sgdiskmon functions plus any errors.
  • /var/log/sgevents β€” logs messages and errors from the sgevt action script.

πŸ’– OPTIONS πŸ’–

the command line options, described below. every single one, because we don't skip.

  • -? β€” displays a summary of the commands sgdiskmon accepts. your little help menu moment ✨
  • -b β€” makes this utility run in background as a daemon. bye bestie, she's got her own thing going now πŸ’€
  • -e β€” causes any file writes to be avoided, such as the log file. no writing, no mess 🌸
  • -m β€” max serial number length of 12 instead of 8 (default). this may be needed if you have Fujistu drives πŸ‘€
  • -n β€” Naming. by default, the device names are displayed as numeric sequences (/dev/sg0). this option shows the device names as alphabetic sequences (/dev/sga). a little rebrand, iykyk πŸ”€
  • -r β€” Run once. by default, this utility runs in a continuous loop. this option causes it to only run one pass. one and done, main character energy πŸŽ€
  • -t β€” Time interval. the default polling interval is 5 seconds. this option can set the interval to a different number of seconds. your clock, your rules ⏰
  • -x β€” causes extra debug messages to be displayed. the verbose queen we deserve πŸ”₯

😭 ERRORS 😭

okay so if you're filing a problem report, please supply the contents of the /var/log/sgdiskmon.log and /var/log/sgevents files with it. both. don't make her ask twice πŸ™ˆ

also note that sgdiskmon has an option for additional debug output (-x). and you can check http://scsirastools.sourceforge.net for a bug list, ChangeLog, and any later versions of sgdiskmon. very much giving "check the group chat before you ask".

there are some unique error codes defined in sgdiskmon as follows:

  • -1 β€” is an error from a generic system function, check errno value.
  • -2 β€” means that the SCSI request returned a check condition (sense error).
  • -3 β€” means that the SCSI request failed while writing the command.
  • -4 β€” means that the SCSI request failed while reading the response.
  • -5 β€” means that the device did not respond to basic SCSI ioctl functions.
  • -6 β€” means that the SCSI Inquiry returned an invalid size, so that device may be an impostor (failed). 🚩 not her being fake the whole time

🧚 SEE ALSO 🧚

sgdiag(8) sgdskfl(8) sgmode(8) sgraidmon(8)

the whole friend group, fr fr 🫢


⭐ WARNINGS ⭐

see http://sourceforge.net/projects/scsirastools/ for a bug list and any later versions of this utility. don't say i didn't warn you πŸ’œ


Copyright (C) 2006 Intel Corp.

sgdiskmon is open source software. You can redistribute it and/or modify it under the terms of the BSD License. See the COPYING file included with this software package for more details regarding distribution. 🌈

sgdiskmon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. (all caps because it's serious, sorry 😭)


πŸŽ€ AUTHOR πŸŽ€

Andy Cress <arcress@users.sourceforge.net>


and that's the page!! Version 1.3: 23 Oct 2003 β€” yeah she's vintage, she's a classic, she ate πŸ’…βœ¨ go touch some SCSI devices bestie, ily πŸ¦‹

πŸ“¦ where this page comes from