koverstreet / bcachefs

Other
643 stars 71 forks source link

Format with block_size bigger than 4k fails. #651

Closed bichovis closed 5 months ago

bichovis commented 5 months ago

On arch Linux with kernel version 6.7.4-arch1-1

Trying to format a system with a 64k block size returns this error: ❯ sudo bcachefs format --block_size=64k --label=ssd /dev/sda Invalid option block_size: too big (max 65536)

Trying with bytes instead of kbytes... ❯ sudo bcachefs format --block_size=65536 --label=ssd /dev/sda Invalid option block_size: too big (max 65536)

But formatting with a lower block size bigger than 4k works. But then it doesn't mount.

sudo bcachefs format --block_size=32k --label=ssd /dev/sda External UUID: e6175534-e211-4b45-81e2-61a2763aba4b Internal UUID: 99ab4ae6-ce42-4d4d-bee3-29c2cb5788a4 Magic number: c68573f6-66ce-90a9-d96a-60cf803df7ef Device index: 0 Label:
Version: 1.3: rebalance_work Version upgrade complete: 0.0: (unknown version) Oldest version on disk: 1.3: rebalance_work Created: Thu Feb 8 13:50:00 2024 Sequence number: 0 Time of last write: Thu Jan 1 01:00:00 1970 Superblock size: 1016 Clean: 0 Devices: 1 Sections: members_v1,disk_groups,members_v2 Features:
Compat features:

Options: block_size: 32.0 KiB btree_node_size: 256 KiB errors: continue [ro] panic metadata_replicas: 1 data_replicas: 1 metadata_replicas_required: 1 data_replicas_required: 1 encoded_extent_max: 64.0 KiB metadata_checksum: none [crc32c] crc64 xxhash data_checksum: none [crc32c] crc64 xxhash compression: none background_compression: none str_hash: crc32c crc64 [siphash] metadata_target: none foreground_target: none background_target: none promote_target: none erasure_code: 0 inodes_32bit: 1 shard_inode_numbers: 1 inodes_use_key_cache: 1 gc_reserve_percent: 8 gc_reserve_bytes: 0 B root_reserve_percent: 0 wide_macs: 0 acl: 1 usrquota: 0 grpquota: 0 prjquota: 0 journal_flush_delay: 1000 journal_flush_disabled: 0 journal_reclaim_delay: 100 journal_transaction_names: 1 version_upgrade: [compatible] incompatible none nocow: 0

members_v2 (size 144): Device: 0 Label: ssd (0) UUID: a7528740-ae3c-45a3-9f9f-b71bf03b303a Size: 119 GiB read errors: 0 write errors: 0 checksum errors: 0 seqread iops: 0 seqwrite iops: 0 randread iops: 0 randwrite iops: 0 Bucket size: 256 KiB First bucket: 0 Buckets: 488417 Last mount: (never) Last superblock write: 0 State: rw Data allowed: journal,btree,user Has data: (none) Durability: 1 Discard: 0 Freespace initialized: 0

Let's try to mount it. ❯ mkdir SSD ❯ sudo bcachefs mount /dev/sda ~/SSD ERROR - bcachefs_rust::cmd_mount: Fatal error: "invalid_sb_block_size" ❯ sudo dmesg | tail [ 907.783779] microsoft 0005:045E:0B13.0009: input,hidraw6: BLUETOOTH HID v5.13 Gamepad [Xbox Wireless Controller] on 48:e7:da:10:5a:a6 [ 911.643539] Bluetooth: hci0: ACL packet for unknown connection handle 3837 [ 1240.256672] block nvme0n1: No UUID available providing old NGUID [ 1240.920898] warning: `ThreadPoolForeg' uses wireless extensions which will stop working for Wi-Fi 7 hardware; use nl80211 [ 1435.328263] input: JBL Go 3 (AVRCP) as /devices/virtual/input/input34 [ 1435.752926] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.000A/input/input35 [ 1435.753078] microsoft 0005:045E:0B13.000A: input,hidraw6: BLUETOOTH HID v5.13 Gamepad [Xbox Wireless Controller] on 48:e7:da:10:5a:a6 [ 1440.033625] input: JBL Go 3 (AVRCP) as /devices/virtual/input/input36 [ 2765.480405] bcachefs (sda): ro [ 2808.844413] bcachefs (sdc): ro

block_size of 4k and 512 works ok.

koverstreet commented 5 months ago

Why do you want a 64k block size? We don't support block size > page size yet, and there's no reason to use a block size larger than what your block device supports.