Skip to content
Snippets Groups Projects
  • anarcat's avatar
    bd009bf1
    use a more canonical mkfs command · bd009bf1
    anarcat authored
    At the time of writing, we have the following ways of creating a
    filesystem in the wiki:
    
        anarcat@curie:help.torproject.org(master)$ git grep mkfs
        howto/ganeti.md:        mkfs /dev/vg_ganeti/srv-tmp &&
        howto/ganeti.md:        mkfs /dev/vg_ganeti/srv &&
        howto/lvm.md:    mkfs -t ext4 /dev/vg_ganeti/srv
        howto/new-machine-cymru.md:    mkfs.ext4 -j /dev/mapper/36782bcb00063c6a500000aa36036318d
        old/new-kvm-virsh-vm.md:mkfs.ext4 "$part1"
        service/ci.md:        mkfs -t ext4 -j /dev/sdc
    
    Most of them use `-t ext4` instead of `.ext4`. I consider that to be
    best practice, because it doesn't assume implementation
    details (e.g. the existence of `mkfs.ext4`) in `mkfs`.
    
    We especially do not, ever, use `-m` in the filesystem creation, let
    alone with "zero percent". That feels like a bad idea in general: if
    we run out of disk space, we have no emergency procedure to
    recover. We should definitely avoid that: in some cases, we *may* want
    to reduce the percentage from the default (5%) to something
    smaller (say 1%, it even supports fractional percentages).
    
    We should probably *always* use a journal as well, although by
    default (in `mke2fs.conf`) the journal is enabled by
    default (`has_journal`) is set, so it is really redundant nowadays.
    bd009bf1
    History
    use a more canonical mkfs command
    anarcat authored
    At the time of writing, we have the following ways of creating a
    filesystem in the wiki:
    
        anarcat@curie:help.torproject.org(master)$ git grep mkfs
        howto/ganeti.md:        mkfs /dev/vg_ganeti/srv-tmp &&
        howto/ganeti.md:        mkfs /dev/vg_ganeti/srv &&
        howto/lvm.md:    mkfs -t ext4 /dev/vg_ganeti/srv
        howto/new-machine-cymru.md:    mkfs.ext4 -j /dev/mapper/36782bcb00063c6a500000aa36036318d
        old/new-kvm-virsh-vm.md:mkfs.ext4 "$part1"
        service/ci.md:        mkfs -t ext4 -j /dev/sdc
    
    Most of them use `-t ext4` instead of `.ext4`. I consider that to be
    best practice, because it doesn't assume implementation
    details (e.g. the existence of `mkfs.ext4`) in `mkfs`.
    
    We especially do not, ever, use `-m` in the filesystem creation, let
    alone with "zero percent". That feels like a bad idea in general: if
    we run out of disk space, we have no emergency procedure to
    recover. We should definitely avoid that: in some cases, we *may* want
    to reduce the percentage from the default (5%) to something
    smaller (say 1%, it even supports fractional percentages).
    
    We should probably *always* use a journal as well, although by
    default (in `mke2fs.conf`) the journal is enabled by
    default (`has_journal`) is set, so it is really redundant nowadays.