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

tune2fs

Show and change the settings of an ext2/ext3/ext4 file system (label, reserved blocks, default mount options, checks, UUID).

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

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

Wat het doet

tune2fs -l DEVICE lists the superblock: label, UUID, features, mount count, reserved blocks and more. Other options change these values, mostly without unmounting. Some changes (like a new UUID or inode size) need the file system to be unmounted.

Zo schrijf je het

tune2fs [OPTION]... DEVICE

Opties 21

Meest gebruikt

-l
List the superblock contents.
-L LABEL
Set the label (max 16 characters).
-m PERCENT
Reserved blocks for root in percent.
-r COUNT
Reserved blocks as a number.
-u USER, -g GROUP
Who may use the reserved blocks.
-o [^]OPTION[,...]
Default mount options, like acl, user_xattr, journal_data (^ = remove).
-O [^]FEATURE[,...]
Turn features on or off, like ^has_journal, metadata_csum.
-E OPTIONS
Extended options: stride=, stripe_width=, mount_opts=, hash_alg= …
-c N
Check after N mounts (-1 = never).
-C N
Set the current mount count.
-i N[d|m|w]
Check after this time (0 = never).
-T TIME
Set the time of the last check.
-e continue|remount-ro|panic
Behaviour on errors.
-U UUID|random|time|clear
Set a new UUID (unmounted for most cases).
-j
Add a journal (ext2 → ext3).
-J OPTIONS
Journal options.
-I SIZE
Change the inode size (unmounted).
-M DIR
Set the last mounted directory.
-Q OPTIONS
Quota options: usrquota, grpquota, prjquota.
-f
Force (dangerous).
-z FILE
Save an undo file.

Voorbeelden 10

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

  1. 1Show all settings

    tune2fs -l /dev/vdb2 | less

    Label, UUID, features, counts.

  2. 2Set a label

    tune2fs -L backup /dev/vdb2

    Then mount with LABEL=backup.

  3. 3Less space reserved for root

    tune2fs -m 1 /dev/vdb2

    Frees 4 % of a big data disk.

  4. 4Default mount options

    tune2fs -o acl,user_xattr /dev/vdb2

    Used even when fstab says only defaults.

  5. 5Turn off forced checks

    tune2fs -c -1 -i 0 /dev/vdb2

    No surprise fsck at boot after N mounts.

  6. 6New UUID for a cloned disk

    umount /backup; tune2fs -U random /dev/vdb2

    Two disks with the same UUID confuse fstab and LVM.

  7. 7Remount read-only on errors (safer)

    tune2fs -e remount-ro /dev/vdb2

    Stops more damage when the disk has errors.

  8. 8Enable quotas

    tune2fs -O quota -Q usrquota,grpquota /dev/vdb2

    Needs the file system unmounted.

  9. 9Show the reserved blocks

    tune2fs -l /dev/vdb2 | grep -i 'reserved block count'

    Compare with the block count.

  10. 10Check the mount count and last check

    tune2fs -l /dev/vdb2 | grep -E 'Mount count|Last checked'

    Maintenance information.

Exitcodes

0Done.
1Error.

Volledige handleiding

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

In je terminal: man 8 tune2fs