Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

xfs_admin

Show or change the label, UUID and some features of an XFS file system (unmounted).

Niveau
RHCSA-examen
Groep
Schijven en bestandssystemen
Root nodig
Ja
Pakket
xfsprogs

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

xfs_admin changes XFS settings that are fixed at creation, mainly the label and the UUID. The file system must be unmounted for changes (newer versions can set the label of a mounted file system with xfs_io -c 'label -s NAME' MOUNTPOINT).

Zo schrijf je het

xfs_admin [-eflpu] [-O FEATURES] [-c 0|1] [-L LABEL] [-U UUID] DEVICE [LOGDEV]

Opties 12

Meest gebruikt

-l
Print the label.
-L LABEL
Set the label (max 12 characters; -- = remove).
-u
Print the UUID.
-U UUID|generate|nil|restore
Set a new UUID.
-O FEATURE=STATUS, ...
Change features, like bigtime=1, inobtcount=1.
-c 0|1
Turn lazy counters off or on.
-e
Enable unwritten extents (old file systems).
-j
Enable version 2 log format (old file systems).
-p
Enable 32-bit project IDs.
-f
The DEVICE is an image file.
-r RTDEV
The realtime device.
-V
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Show the label and UUID

    xfs_admin -l -u /dev/vdb1
    label = "data"
    UUID = 4e5c7a6b-3f1d-4c2e-9a5b-7d2f8e1c0a93

    Same values as blkid.

  2. 2Set a label

    umount /data; xfs_admin -L data /dev/vdb1

    Unmount first.

  3. 3Remove the label

    xfs_admin -L -- /dev/vdb1

    Clears it.

  4. 4New UUID for a cloned disk

    xfs_admin -U generate /dev/vdb1

    Two XFS file systems with the same UUID cannot be mounted at the same time.

  5. 5Mount a clone once without changing it

    mount -o nouuid /dev/vdc1 /mnt

    Temporary workaround.

  6. 6Label on a mounted file system (newer xfsprogs)

    xfs_io -c 'label -s data' /data

    No unmount needed.

  7. 7Enable timestamps after 2038

    xfs_admin -O bigtime=1 /dev/vdb1

    New file systems have it by default.

  8. 8Check the result

    lsblk -f /dev/vdb1

    LABEL and UUID columns.

  9. 9Fix fstab after a UUID change

    grep vdb1 /etc/fstab; blkid -s UUID -o value /dev/vdb1

    Update the UUID in fstab or the system may not boot.

  10. 10Info of a mounted XFS

    xfs_info /data

    xfs_admin needs unmounted devices; xfs_info works on mounted ones.

Exitcodes

0 :: Done. 1 :: Error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man 8 xfs_admin