koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
120 stars 89 forks source link

Change label after the fact #246

Open BlackLotus opened 6 months ago

BlackLotus commented 6 months ago

I'm not sure if I'm blind or can't read the documentation, but I can't seem to find a way to change the device name/label after the fact. When formatting you can simply specify it with -l, but bcachefs set-option doesn't have -l, /sys/fs/bcachefs/ doesn't seem to have an option for it and the documentation doesn't mention it either (afaict)

darkskiez commented 3 months ago

It doesn't seem to be in the tooling yet... but.

echo hdd.hdd2 > /sys/fs/bcachefs/$BLKID/dev-$DEVID/label

if you're not sure on these values but know the linux block device name, you can follow the link from the device itself, eg.

echo hdd.hdd2 > /sys/class/block/sda1/bcachefs/label

you can also change discard and durability options in there.