LINUX.ORG.RU

История изменений

Исправление uwuwuu, (текущая версия) :

Короче, я решил проверить утверждение про то, что переполнение файловой системы убивает BTRFS. И ЭТО НЕПРАВДА!!!

~
❯ cd /tmp                                    

/tmp
❯ fallocate -l 10G btr_container

/tmp
❯ mkfs.btrfs btr_container    
btrfs-progs v6.3
See https://btrfs.readthedocs.io for more information.

NOTE: several default settings have changed in version 5.15, please make sure
      this does not affect your deployments:
      - DUP for metadata (-m dup)
      - enabled no-holes (-O no-holes)
      - enabled free-space-tree (-R free-space-tree)

Label:              (null)
UUID:               d6fd4ff4-c2fb-4db9-a741-759abc271f54
Node size:          16384
Sector size:        4096
Filesystem size:    10.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP             256.00MiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Incompat features:  extref, skinny-metadata, no-holes, free-space-tree
Runtime features:   free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1    10.00GiB  btr_container


/tmp
❯ losetup -f --show btr_container 
losetup: cannot find an unused loop device

/tmp
❯ sudo losetup -f --show btr_container
/dev/loop0

/tmp
❯ sudo mkdir /mnt/test_btr               

/tmp
❯ sudo mount /dev/loop0 /mnt/test_btr

/tmp
❯ sudo btrfs su sh /mnt/test_btr
/
        Name:                   <FS_TREE>
        UUID:                   8eacb7da-3d15-4494-82ef-9aad7ad95971
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2023-06-07 12:10:05 +0300
        Subvolume ID:           5
        Generation:             5
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Send transid:           0
        Send time:              2023-06-07 12:10:05 +0300
        Receive transid:        0
        Receive time:           -
        Snapshot(s):

/tmp
❯ cd /mnt/test_btr

/mnt/test_btr
❯ sudo mkdir -m 0777 test

/mnt/test_btr
❯ cd test                    

/mnt/test_btr/test
❯ touch 1

/mnt/test_btr/test
❯ for ((i=0;i<10*1024;i++)); do dd if=/dev/urandom of=$i.dat bs=1M count=1; done

...
dd: error writing '10239.dat': No space left on device
1+0 records in
0+0 records out
0 bytes copied, 0.00266202 s, 0.0 kB/s

/mnt/test_btr/test 34s
❯ btrfs fi us .
WARNING: cannot read detailed chunk info, per-device usage will not be shown, run as root
Overall:
    Device size:                  10.00GiB
    Device allocated:             10.00GiB
    Device unallocated:            1.00MiB
    Device missing:                  0.00B
    Device slack:                 16.00EiB
    Used:                          9.51GiB
    Free (estimated):                0.00B      (min: 0.00B)
    Free (statfs, df):               0.00B
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:               10.45MiB      (used: 0.00B)
    Multiple profiles:                  no

Data,single: Size:9.48GiB, Used:9.48GiB (100.00%)

Metadata,DUP: Size:256.00MiB, Used:14.94MiB (5.83%)

System,DUP: Size:8.00MiB, Used:16.00KiB (0.20%)

/mnt/test_btr/test
❯ cd .. 

/mnt/test_btr
❯ sudo rm -rf test

/mnt/test_btr
❯ sudo touch foo                   

/mnt/test_btr
❯ sudo dd if=/dev/sda of=dump bs=1M count=1024              
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.18514 s, 337 MB/s

/mnt/test_btr
❯ ls -ahl
total 1.1G
drwxr-xr-x 1 root sergey   14 Jun  7 12:26 .
drwxr-xr-x 1 root root    124 Jun  7 12:11 ..
-rw-r--r-- 1 root root   1.0G Jun  7 12:26 dump
-rw-r--r-- 1 root root      0 Jun  7 12:25 foo

Я добился перевыполнения файловой системы, я удалил файлы, создал новый и все работает. ЧТЯНТ?

Исходная версия uwuwuu, :

Короче, я решил проверить утверждение про то, что переполнение файловой системы убивает BTRFS. И ЭТО НЕПРАВДА!!!

~
❯ cd /tmp                                    

/tmp
❯ fallocate -l 10G btr_container

/tmp
❯ mkfs.btrfs btr_container    
btrfs-progs v6.3
See https://btrfs.readthedocs.io for more information.

NOTE: several default settings have changed in version 5.15, please make sure
      this does not affect your deployments:
      - DUP for metadata (-m dup)
      - enabled no-holes (-O no-holes)
      - enabled free-space-tree (-R free-space-tree)

Label:              (null)
UUID:               d6fd4ff4-c2fb-4db9-a741-759abc271f54
Node size:          16384
Sector size:        4096
Filesystem size:    10.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP             256.00MiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Incompat features:  extref, skinny-metadata, no-holes, free-space-tree
Runtime features:   free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1    10.00GiB  btr_container


/tmp
❯ losetup -f --show btr_container 
losetup: cannot find an unused loop device

/tmp
❯ sudo losetup -f --show btr_container
/dev/loop0

/tmp
❯ sudo mkdir /mnt/test_btr               

/tmp
❯ sudo mount /dev/loop0 /mnt/test_btr

/tmp
❯ sudo btrfs su sh /mnt/test_btr
/
        Name:                   <FS_TREE>
        UUID:                   8eacb7da-3d15-4494-82ef-9aad7ad95971
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2023-06-07 12:10:05 +0300
        Subvolume ID:           5
        Generation:             5
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Send transid:           0
        Send time:              2023-06-07 12:10:05 +0300
        Receive transid:        0
        Receive time:           -
        Snapshot(s):

/tmp
❯ cd /mnt/test_btr

/mnt/test_btr
❯ sudo mkdir -m 0777 test

/mnt/test_btr
❯ cd test                    

/mnt/test_btr/test
❯ touch 1

/mnt/test_btr/test
❯ for ((i=0;i<10*1024;i++)); do dd if=/dev/urandom of=$i.dat bs=1M count=1; done

...
dd: error writing '10239.dat': No space left on device
1+0 records in
0+0 records out
0 bytes copied, 0.00266202 s, 0.0 kB/s

/mnt/test_btr/test 34s
❯ btrfs fi us .
WARNING: cannot read detailed chunk info, per-device usage will not be shown, run as root
Overall:
    Device size:                  10.00GiB
    Device allocated:             10.00GiB
    Device unallocated:            1.00MiB
    Device missing:                  0.00B
    Device slack:                 16.00EiB
    Used:                          9.51GiB
    Free (estimated):                0.00B      (min: 0.00B)
    Free (statfs, df):               0.00B
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:               10.45MiB      (used: 0.00B)
    Multiple profiles:                  no

Data,single: Size:9.48GiB, Used:9.48GiB (100.00%)

Metadata,DUP: Size:256.00MiB, Used:14.94MiB (5.83%)

System,DUP: Size:8.00MiB, Used:16.00KiB (0.20%)

/mnt/test_btr/test
❯ cd .. 

/mnt/test_btr
❯ sudo rm -rf test

/mnt/test_btr
❯ sudo rm -rf test

/mnt/test_btr
❯ sudo touch foo                   

/mnt/test_btr
❯ sudo dd if=/dev/sda of=dump bs=1M count=1024              
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.18514 s, 337 MB/s

/mnt/test_btr
❯ ls -ahl
total 1.1G
drwxr-xr-x 1 root sergey   14 Jun  7 12:26 .
drwxr-xr-x 1 root root    124 Jun  7 12:11 ..
-rw-r--r-- 1 root root   1.0G Jun  7 12:26 dump
-rw-r--r-- 1 root root      0 Jun  7 12:25 foo

Я добился перевыполнения файловой системы, я удалил файлы, создал новый и все работает. ЧТЯНТ?