table of contents
BARREL(8) | Storage Management | BARREL(8) |
NAME¶
barrel - Command-line program for storage management
SYNOPSIS¶
barrel [--global-opts] command [--command-opts] [block-devices]
barrel [--global-opts]
DESCRIPTION¶
Barrel is a command-line program for storage management. It can work with file systems, LUKS, RAIDs and LVM. The main feature of barrel is to combine the various tools needed to manage the different storage systems in one tool. E.g. with a single command of barrel it is possible to create partitions on several disks, create a RAID from those partitions and create a file system on the RAID.
Barrel probes the complete storage system at startup and does not save the state between invocations. That allows to mix barrel with other storage tools, although in general not concurrently.
CONCEPTS¶
Script and Interactive Mode¶
Barrel can run either in script or interactive mode. In script mode the command must be provided on the command line. If no command is provided on the command line the interactive mode is started where a prompt asks for the commands.
Pool¶
Pools are a set of devices and allow barrel to find suitable disk space on its own. For example when the system has several SSDs and the user wants to create a file system on some SSD barrel can pick an SSD with enough space automatically.
So far devices in a pool must have a partition table to be usable.
Stack¶
Barrel has a stack that allows commands to be chained. For example creating a RAID places the resulting RAID on the stack. A consecutive command to create a file system can then pick the RAID from the stack. Using the stack the user does not have to deal with the name of the newly created RAID and thus the two commands can be provided on the command line.
The stack can hold different objects: storage objects (e.g. block devices, LVM volume groups or file systems), a mark and arrays. Arrays are constructed using the [ and ] commands.
Devicegraph¶
Barrel saves all information about storage devices and file systems together with their relations in a devicegraph. At startup the system is probed and the state is saved in the "probed" and the "staging" devicegraphs. All commands, except of the commit command, only modify the staging devicegraph.
Barrel makes a backup of the staging devicegraph whenever it is modified. The last backup can be restored with the command undo.
During commit barrel runs actions to make the system match the staging devicegraph. In script mode a commit it done automatically if needed.
Modi Operandi of Commands¶
Many commands operate significantly different based on the provided options.
For example when creating a file system using create xfs /dev/sdb1 the XFS is created on the partition /dev/sdb1. On the other hand the command create xfs /dev/sdb --size 10G will create a 10 GiB partition on /dev/sdb are the XFS on the new partition. And the command create xfs will take a device from the stack and create the XFS on that device.
GLOBAL OPTIONS¶
-q, --quiet
-v, --verbose
-t, --table-style style
--color
--no-color
--dry-run
--rootprefix path
-a, --activate
--yes
-h, --help format
--version
COMMANDS¶
Barrel provides a number of commands. Many commands have specific options, which are listed in this section. These command-specific options must be specified after the name of the command. For several commands some options are mandatory.
[
]
clear
commit
create encryption [device]
-t, --type type
-n, --name name
--label label
--activate-by type
--activate-options options
--pool-name name
-s, --size size
--key-file
--key-size
--cipher
--pbkdf
--no-crypttab
--force
Possible Modi Operandi are:
Pool
Block Device
Partitionable
Block Device from Stack
Partitionable from Stack
create filesystem [device]
-t, --type type
Not all file systems may be available on the system.
-l, --label label
-p, --path path
For swap the path may be 'swap' or 'none'.
--mount-by type
--mount-options options
--mkfs-options options
--tune-options options
--pool-name options
-s, --size size
Due to file system metadata and for btrfs also data duplication the usable space of the resulting file system can be much smaller.
-d, --devices number
--profile profile
--no-fstab
--force
Possible Modi Operandi are:
Pool
Block Device
Partitionable
Block Devices from Stack
Partitionables from Stack
create lv
-v, --vg-name vg-name
-n, --name name
-s, --size size
--stripes stripes
--stripe-size stripe-size
Possible Modi Operandi are:
Volume Group
Volume Group from Stack
create partition-table [device]
-t, --type type
--force
Possible Modi Operandi are:
Partitionable
Partitionable from Stack
create pool [devices]
-n, --name name
create raid [devices]
-l, --level level
-n, --name name
--pool-name name
-s, --size size
--metadata metadata
-d, --devices number
r
r+s
+s
The default is to use n. n is the number of devices provided or devices of the pool.
--chunk-size chunk-size
--force
Possible Modi Operandi are:
Pool
Block Devices
Partitionables
create vg [devices]
-n, --name name
--pool-name name
-s, --size size
-d, --devices number
--extent-size extent-size
--force
Possible Modi Operandi are:
Pool
Block Devices
Partitionables
Block Devices from Stack
Partitionables from Stack
dup
exch
extend pool devices
-n, --name name
help [main-command [sub-command]]
load devicegraph
This function is still in development. Use with great care.
-n, --name name
-m, --mapping name
load pools
pop
quit
reduce pool devices
-n, --name name
remove device devices
When removing a RAID or encryption device the underlying partitions are also removed. This is not possible if it would cause used partitions to be renumbered, e.g. logical partitions on an MS-DOS partition table.
--keep-partitions
remove pool devices
-n, --name name
rename pool
-o, --old-name name
-n, --new-name name
save devicegraph
-n, --name name
--probed
save pools
show commit
show dasds
--probed
--no-partitions
show disks
--probed
--no-partitions
show encryptions
--probed
show filesystems
--probed
show multipaths
--probed
--no-partitions
show pools
--probed
Devices that are currently not usable since they do not have a partition table are marked with an '!'.
show raids
--probed
--no-partitions
show tree devices
--up
--down
--probed
show vgs
--probed
stack
undo
EXAMPLES¶
barrel create xfs /dev/sdb1 --path /test
barrel create xfs /dev/sdb --size 10G --path /test
barrel create btrfs --size 1TiB --pool "SSDs (512 B)" --devices 2 --profiles raid0,raid1 --path /test
barrel create raid1 /dev/sd[bc]1 xfs --path /test
barrel create raid5 --size 1TiB --pool "HDDs (512 B)" --devices 3+1 xfs --path /test
barrel create vg --name vg1 --size 1TiB /dev/sdb lv --name lv1 --size 100G xfs --path /test
FILES¶
/etc/barrel/pools.json
/var/log/barrel.log
BUGS AND MISSING FEATURES¶
HOMEPAGE¶
AUTHORS¶
Arvin Schnell <aschnell@suse.com>
SEE ALSO¶
parted(8), mkfs(8), mount(8), mdadm(8), lvm(8), cryptsetup(8), fstab(5), crypttab(5), mdadm.conf(5)
2024-07-16 | 0.2.8 |