linux:truenas:boot-pool:expand
扩容TrueNAS的boot-pool大小
因为之前使用一块小的32G固态做启动盘,因为之前的truneNAS也不怎么写启动盘,后来升级到24大版本后就狂写入,很快32G的固态就寿命耗尽了,只好换个块闲置的1T机械盘给他顶替。
切换硬盘做boot-pool到时很简单,菜单里面就搞定了。但是替换后的硬盘布局还是之前的32G固态的,不会自动扩容,然后自己就研究了下怎么扩容,基本办法如下:
- 基本操作命令
# list of set commands zpool set # check autoexpand status zpool get autoexpand,expandsize # enable autoexpand zpool set autoexpand=on <pool name> # expand online zpool online -e <pool name> <disk partition>
admin@truenas[~]$ sudo -i [sudo] password for admin: root@truenas[~]# zpool set missing property=value argument usage: set <property=value> <pool> set <vdev_property=value> <pool> <vdev> the following properties are supported: PROPERTY EDIT VALUES allocated NO <size> bcloneratio NO <1.00x or higher if cloned> bclonesaved NO <size> bcloneused NO <size> capacity NO <percent> checkpoint NO <size> dedup_table_size NO <size> dedupratio NO <1.00x or higher if deduped> expandsize NO <size> fragmentation NO <percent> free NO <size> freeing NO <size> guid NO <guid> health NO <state> last_scrubbed_txg NO <txg> leaked NO <size> load_guid NO <load_guid> size NO <size> altroot YES <path> ashift YES <ashift, 9-16, or 0=default> autoexpand YES on | off autoreplace YES on | off autotrim YES on | off bootfs YES <filesystem> cachefile YES <file> | none comment YES <comment-string> compatibility YES <file[,file...]> | off | legacy dedup_table_quota YES <size> delegation YES on | off failmode YES wait | continue | panic listsnapshots YES on | off multihost YES on | off readonly YES on | off version YES <version> feature@... YES disabled | enabled | active The feature@ properties must be appended with a feature name. See zpool-features(7). root@truenas[~]# zpool status pool: boot-pool state: ONLINE status: One or more devices has experienced an error resulting in data corruption. Applications may be affected. action: Restore the file in question if possible. Otherwise restore the entire pool from backup. see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A scan: scrub repaired 0B in 00:02:41 with 4 errors on Wed Jul 16 14:34:51 2025 config: NAME STATE READ WRITE CKSUM boot-pool ONLINE 0 0 0 sda3 ONLINE 0 0 24 errors: 4 data errors, use '-v' for a list pool: mypool state: ONLINE scan: scrub repaired 0B in 02:57:49 with 0 errors on Sun Jun 15 02:57:50 2025 config: NAME STATE READ WRITE CKSUM mypool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 e883f864-998f-47f2-bad9-9fb8af116ff6 ONLINE 0 0 0 ea2912e6-30c8-42d3-b9e7-76ed5a0c0535 ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 423e052b-7e9b-4d8b-b81d-e1ffaef19876 ONLINE 0 0 0 cf496c36-b3c2-4a06-b876-d236ad5967ba ONLINE 0 0 0 mirror-2 ONLINE 0 0 0 d0777dc2-484e-4f17-afbd-c2e5155aea09 ONLINE 0 0 0 02090ba5-2af1-4066-b36a-53288b53fb6c ONLINE 0 0 0 errors: No known data errors root@truenas[~]# zpool get autoexpand,expandsize NAME PROPERTY VALUE SOURCE boot-pool autoexpand off default boot-pool expandsize 902G - mypool autoexpand on local mypool expandsize - - root@truenas[~]# zpool set autoexpand=on boot-pool root@truenas[~]# zpool online -e boot-pool sda3 root@truenas[~]# zpool get autoexpand,expandsize NAME PROPERTY VALUE SOURCE boot-pool autoexpand on local boot-pool expandsize - - mypool autoexpand on local mypool expandsize - -
最后再看下菜单的boot的大小,已经扩容到1T硬盘的大小了,收工。
参考资料:
https://www.truenas.com/docs/scale/scaletutorials/systemsettings/managebootenvironscale/
linux/truenas/boot-pool/expand.txt · 最后更改: 由 packingbox