LDEV(8)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LDEV(8) β€” the lustre device utility, bestie edition πŸ’–

okay so this is ldev, and it lives in the Lustre Configuration Utilities section of the manual (that's section 8, for the admins in the chat 🫢).


✨ NAME ✨

ldev β€” the lustre device utility. that's it, that's the girl πŸ’…


🌸 SYNOPSIS 🌸

ldev [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: ldev is what you use to query information about lustre devices that are configured in /etc/ldev.conf. that's the config file, she's the blueprint, she holds the lore ✨

and who uses her? the lustre init script. so like, she's not just cute, she's essential. main character energy fr fr πŸ‘‘


πŸ’… OPTIONS πŸ’…

ldev accepts the following options, and no we are not skipping any of them, every single one gets her moment:

  • -h, --help β€” display the help message. she's helping πŸ₯°
  • -c, --config FILE β€” set the path to the config file.
  • -H, --hostname NAME β€” use NAME instead of the local hostname when doing queries. like, pretend to be someone else for a sec πŸ’€
  • -p, --partner β€” print the hostname of the failover partner.
  • -l, --local β€” print labels for local devices.
  • -f, --foreign β€” print labels for foreign devices.
  • -a, --all β€” print labels for local and foreign devices. all of them. the whole roster 🌈
  • -F, --filesys NAME β€” print labels for file system NAME.
  • -s, --sanity β€” sanity check the config on this node. if any expected local or foreign devices are not present, print an error. if devices do not contain the expected labels, print an error. so basically she's doing a vibe check and reporting back 😀✨
  • -d, --device LABEL β€” print the storage device of LABEL.
  • -j, --journal LABEL β€” print the journal device corresponding to LABEL, if defined.
  • -r, --raidtab LABEL β€” print the Linux software raid configuration file, or the ZFS cache file, associated with LABEL, if there is any.
real talk: using non-default names for these files may help prevent arrays from being automatically started by the system. this is important in failover configurations, where the timing of device initialization must be strictly controlled. like, do not freestyle this one bestie 🚨
  • -t, --type LABEL β€” print the device type of LABEL, i.e. "zfs" or "md".
  • -z, --zpool LABEL β€” print the zpool containing LABEL.
  • -R, --role ROLE β€” filter the output based on role, i.e. mdt, ost, mgs.
  • CMD [ARGS...] β€” run one instance of CMD [ARGS] for each label, in parallel. only the local labels are used by default, but foreign, all, or file system labels may be selected by adding the --foreign, --all, or --filesys options. the following substitutions get made:
    • %f=fsname
    • %d=device
    • %j=journal
    • %i=index
    • %I=hex-index
    • %t=type
    • %l=label
    • %n=nid
    • %N=failnid
    • %m=mgsnid
    • %H=hostname
    • %b=backing-fs

on failure of any child processes, ldev will return a non-zero exit code. noted πŸ“

it is an error if %n, %N, or %m is used in a command and /etc/nids does not contain appropriate host to NID mappings. so don't do that unless /etc/nids has the receipts 🧾


πŸŽ€ FILES πŸŽ€

  • /etc/ldev.conf
  • /etc/nids

⭐ EXAMPLES ⭐

to run a preen check on all devices in a cluster in parallel:

pdsh -S -g ost ldev fsck.ldiskfs -p %d

to re-format an entire file system:

#!/usr/bin/bash -xe
export FANOUT=64

# MDTs
# pdsh -S -g mds service lustre stop
# pdsh -S -g mds ldev yes \| mkfs.ldiskfs -q -b4096 -Ojournal_dev %j
# pdsh -S -g mds ldev dd if=/dev/zero of=%d count=8
# pdsh -S -g mds ldev mkfs.lustre --mdt --mgs --fsname=%f \
        --index=%i --mkfsoptions=-Jdevice=%j --mkfsoptions=-i2048 \
        --mountfsoptions=errors=panic,iopen_nopriv,user_xattr,\
                         maxdirsize=20000000 %d
# pdsh -S -g mds ldev tune.ldiskfs -i0 -m0 -c0 %d

# OSTs
mgs=172.16.2.200@tcp0
# pdsh -S -g ost service heartbeat stop
# pdsh -S -g ost service lustre stop
# pdsh -S -g ost ldev dd if=/dev/zero of=%d count=8
# pdsh -S -g ost ldev mkfs.lustre --ost --mgsnode=$mgs --fsname=%f \
        --index=%i --param=lov.stripecount=2 --failnode=%N \
        --mountfsoptions=errors=panic,extents,mballoc %d
# pdsh -S -g ost ldev tune.ldiskfs -epanic -i0 -m0 -c0 %d

(it's giving absolute cinema, do not run this casually πŸ™ˆ)


🌈 AVAILABILITY 🌈

ldev is part of the lustre(7) filesystem package since release 0.8.0. she's been iconic since day one, no cap πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie!! πŸ’œ this one's from the Lustre crew, dated 2024-08-29 β€” go forth and query your devices responsibly 🫢✨

πŸ“¦ where this page comes from