Linux2024. 2. 13. 10:20

btrfs는 fsck로 체크 못하고, btrfs 유틸리티의 check 명령을 통해서 확인해야 한다.

# fsck /dev/mmcblk2p9
fsck from util-linux 2.37.4
If you wish to check the consistency of a BTRFS filesystem or
repair a damaged filesystem, see btrfs(8) subcommand 'check'.

# btrfs
btrfs               btrfs-convert       btrfs-find-root     btrfs-image         btrfs-map-logical   btrfs-select-super  btrfsck             btrfstune           

# btrfs check /dev/mmcblk2p9
Opening filesystem to check...
Checking filesystem on /dev/mmcblk2p9
UUID: a6226cd4-fc4e-4e20-8861-5870feefb3da
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 12189671424 bytes used, no error found
total csum bytes: 11890008
total tree bytes: 14303232
total fs tree bytes: 180224
total extent tree bytes: 229376
btree space waste bytes: 1957387
file data blocks allocated: 12175368192
 referenced 12171370496

 

man은 안되서 --help를 보는데 내용이 부실하긴 하다. restore와 rescue는 어떨 때 쓸 수 있으려나?

# btrfs --help
usage: btrfs [--help] [--version] [--format <format>] [-v|--verbose] [-q|--quiet] <group> [<group>...] <command> [<args>]

    btrfs balance start [options] <path>
        Balance chunks across the devices
    btrfs balance pause <path>
        Pause running balance
    btrfs balance cancel <path>
        Cancel running or paused balance
    btrfs balance resume <path>
        Resume interrupted balance
    btrfs balance status [-v] <path>
        Show status of running or paused balance

    btrfs check [options] <device>
        Check structural integrity of a filesystem (unmounted).

    btrfs device add [options] <device> [<device>...] <path>
        Add one or more devices to a mounted filesystem.
    btrfs device delete <device>|<devid> [<device>|<devid>...] <path>
    btrfs device remove <device>|<devid> [<device>|<devid>...] <path>
        Remove a device from a filesystem
    btrfs device scan [-d|--all-devices] <device> [<device>...]
    btrfs device scan -u|--forget [<device>...]
        Scan or forget (unregister) devices of btrfs filesystems
    btrfs device ready <device>
        Check and wait until a group of devices of a filesystem is ready for mount
    btrfs device stats [options] <path>|<device>
        Show device IO error statistics
    btrfs device usage [options] <path> [<path>..]
        Show detailed information about internal allocations in devices.

    btrfs filesystem df [options] <path>
        Show space usage information for a mount point
    btrfs filesystem du [options] <path> [<path>..]
        Summarize disk usage of each file.
    btrfs filesystem show [options] [<path>|<uuid>|<device>|label]
        Show the structure of a filesystem
    btrfs filesystem sync <path>
        Force a sync on a filesystem
    btrfs filesystem defragment [options] <file>|<dir> [<file>|<dir>...]
        Defragment a file or a directory
    btrfs filesystem resize [options] [devid:][+/-]<newsize>[kKmMgGtTpPeE]|[devid:]max <path>
        Resize a filesystem
    btrfs filesystem label [<device>|<mount_point>] [<newlabel>]
        Get or change the label of a filesystem
    btrfs filesystem usage [options] <path> [<path>..]
        Show detailed information about internal filesystem usage .

    btrfs inspect-internal inode-resolve [-v] <inode> <path>
        Get file system paths for the given inode
    btrfs inspect-internal logical-resolve [-Pvo] [-s bufsize] <logical> <path>
        Get file system paths for the given logical address
    btrfs inspect-internal subvolid-resolve <subvolid> <path>
        Get file system paths for the given subvolume ID.
    btrfs inspect-internal rootid <path>
        Get tree ID of the containing subvolume of path.
    btrfs inspect-internal min-dev-size [options] <path>
        Get the minimum size the device can be shrunk to
    btrfs inspect-internal dump-tree [options] <device> [<device> ..]
        Dump tree structures from a given device
    btrfs inspect-internal dump-super [options] device [device...]
        Dump superblock from a device in a textual form
    btrfs inspect-internal tree-stats [options] <device>
        Print various stats for trees

    btrfs property get [-t <type>] <object> [<name>]
        Get a property value of a btrfs object
    btrfs property set [-f] [-t <type>] <object> <name> <value>
        Set a property on a btrfs object
    btrfs property list [-t <type>] <object>
        Lists available properties with their descriptions for the given object

    btrfs qgroup assign [options] <src> <dst> <path>
        Assign SRC as the child qgroup of DST
    btrfs qgroup remove [options] <src> <dst> <path>
        Remove a child qgroup SRC from DST.
    btrfs qgroup create <qgroupid> <path>
        Create a subvolume quota group.
    btrfs qgroup destroy <qgroupid> <path>
        Destroy a quota group.
    btrfs qgroup show [options] <path>
        Show subvolume quota groups.
    btrfs qgroup limit [options] <size>|none [<qgroupid>] <path>
        Set the limits a subvolume quota group.

    btrfs quota enable <path>
        Enable subvolume quota support for a filesystem.
    btrfs quota disable <path>
        Disable subvolume quota support for a filesystem.
    btrfs quota rescan [-sw] <path>
        Trash all qgroup numbers and scan the metadata again with the current config.

    btrfs receive [options] <mount>
    btrfs receive --dump [options]
        Receive subvolumes from a stream

    btrfs replace start [-Bfr] <srcdev>|<devid> <targetdev> <mount_point>
        Replace device of a btrfs filesystem.
    btrfs replace status [-1] <mount_point>
        Print status and progress information of a running device replace operation
    btrfs replace cancel <mount_point>
        Cancel a running device replace operation.

    btrfs rescue chunk-recover [options] <device>
        Recover the chunk tree by scanning the devices one by one.
    btrfs rescue super-recover [options] <device>
        Recover bad superblocks from good copies
    btrfs rescue zero-log <device>
        Clear the tree log. Usable if it's corrupted and prevents mount.
    btrfs rescue fix-device-size <device>
        Re-align device and super block sizes. Usable if newer kernel refuse to mount it due to mismatch super size
    btrfs rescue create-control-device
        Create /dev/btrfs-control (see 'CONTROL DEVICE' in btrfs(5))
    btrfs rescue clear-uuid-tree
        Delete uuid tree so that kernel can rebuild it at mount time

    btrfs restore [options] <device> <path>
    btrfs restore [options] -l <device>
        Try to restore files from a damaged filesystem (unmounted)

    btrfs scrub start [-BdqrRf] [-c ioprio_class -n ioprio_classdata] <path>|<device>
        Start a new scrub. If a scrub is already running, the new one fails.
    btrfs scrub cancel <path>|<device>
        Cancel a running scrub
    btrfs scrub resume [-BdqrR] [-c ioprio_class -n ioprio_classdata] <path>|<device>
        Resume previously canceled or interrupted scrub
    btrfs scrub status [-dR] <path>|<device>
        Show status of running or finished scrub

    btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]
        Send the subvolume(s) to stdout.

    btrfs subvolume create [-i <qgroupid>] [<dest>/]<name>
        Create a subvolume
    btrfs subvolume delete [options] <subvolume> [<subvolume>...]
    btrfs subvolume delete [options] -i|--subvolid <subvolid> <path>
        Delete subvolume(s)
    btrfs subvolume list [options] <path>
        List subvolumes and snapshots in the filesystem.
    btrfs subvolume snapshot [-r] [-i <qgroupid>] <subvolume> { <subdir>/<name> | <subdir> }
        
    btrfs subvolume get-default <path>
        Get the default subvolume of a filesystem
    btrfs subvolume set-default <subvolume>
    btrfs subvolume set-default <subvolid> <path>
        Set the default subvolume of the filesystem mounted as default.
    btrfs subvolume find-new <path> <lastgen>
        List the recently modified files in a filesystem
    btrfs subvolume show [options] <path>
        Show more information about the subvolume (UUIDs, generations, times, snapshots)
    btrfs subvolume sync <path> [<subvol-id>...]
        Wait until given subvolume(s) are completely removed from the filesystem.

    btrfs help [--full] [--box]
        Display help information
    btrfs version
        Display btrfs-progs version

Use --help as an argument for information on a specific group or command.
Options for --format are: text, json

[링크 : https://www.nemonein.xyz/2019/12/2861/]

'Linux' 카테고리의 다른 글

lsusb -v 로 본 장치(HID MT, mouse)  (0) 2024.03.08
systemd 지연된 시작  (0) 2024.02.29
리눅스 파일 시스템 캐싱  (0) 2024.01.09
minicom에서 stty로 터미널 폭 조절하기  (0) 2023.10.24
multitail / tail  (2) 2023.10.18
Posted by 구차니