Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
6.3. Resizing a btrfs File System
It is not possible to resize a btrfs file system but it is possible to resize each of the devices it uses. If there is only one device in use then this works the same as resizing the file system. If there are multiple devices in use then they must be manually resized to achieve the desired result.
Note
The unit size is not case specific; it accepts both
G
or g
for GiB.
The command does not accept
t
for terabytes or p
for petabytes. It only accepts k
, m
, and g
.
Enlarging a btrfs File System Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To enlarge the file system on a single device, use the command:
btrfs filesystem resize amount /mount-point
# btrfs filesystem resize amount /mount-point
For example:
btrfs filesystem resize +200M /btrfssingle
# btrfs filesystem resize +200M /btrfssingle
Resize '/btrfssingle' of '+200M'
To enlarge a multi-device file system, the device to be enlarged must be specified. First, show all devices that have a btrfs file system at a specified mount point:
btrfs filesystem show /mount-point
# btrfs filesystem show /mount-point
For example:
Then, after identifying the
devid
of the device to be enlarged, use the following command:
btrfs filesystem resize devid:amount /mount-point
# btrfs filesystem resize devid:amount /mount-point
For example:
btrfs filesystem resize 2:+200M /btrfstest
# btrfs filesystem resize 2:+200M /btrfstest
Resize '/btrfstest/' of '2:+200M'
Note
The amount can also be
max
instead of a specified amount. This will use all remaining free space on the device.
Shrinking a btrfs File System Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To shrink the file system on a single device, use the command:
btrfs filesystem resize amount /mount-point
# btrfs filesystem resize amount /mount-point
For example:
btrfs filesystem resize -200M /btrfssingle
# btrfs filesystem resize -200M /btrfssingle
Resize '/btrfssingle' of '-200M'
To shrink a multi-device file system, the device to be shrunk must be specified. First, show all devices that have a btrfs file system at a specified mount point:
btrfs filesystem show /mount-point
# btrfs filesystem show /mount-point
For example:
Then, after identifying the
devid
of the device to be shrunk, use the following command:
btrfs filesystem resize devid:amount /mount-point
# btrfs filesystem resize devid:amount /mount-point
For example:
btrfs filesystem resize 2:-200M /btrfstest
# btrfs filesystem resize 2:-200M /btrfstest
Resize '/btrfstest' of '2:-200M'
Set the File System Size Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To set the file system to a specific size on a single device, use the command:
btrfs filesystem resize amount /mount-point
# btrfs filesystem resize amount /mount-point
For example:
btrfs filesystem resize 700M /btrfssingle
# btrfs filesystem resize 700M /btrfssingle
Resize '/btrfssingle' of '700M'
To set the file system size of a multi-device file system, the device to be changed must be specified. First, show all devices that have a btrfs file system at the specified mount point:
btrfs filesystem show /mount-point
# btrfs filesystem show /mount-point
For example:
Then, after identifying the
devid
of the device to be changed, use the following command:
btrfs filesystem resize devid:amount /mount-point
# btrfs filesystem resize devid:amount /mount-point
For example:
btrfs filesystem resize 2:300M /btrfstest
# btrfs filesystem resize 2:300M /btrfstest
Resize '/btrfstest' of '2:300M'