# Festplatte vergrößern

<div id="bkmrk-"></div><main class="" id="bkmrk-how-to-resize%2Fextend" role="main">### How to resize/extend a btrfs formatted root partition

### Environment

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content">SUSE Linux Enterprise Server 11 Service Pack 4 (SLES 11 SP4)  
SUSE Linux Enterprise Server 12 (all Service Packs)  
</div></div></div></div></div></div></div></div></div>### Situation

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content">The general procedure to resize a btrfs formatted file system can be found in the SLE 12 Storage Admin Guide. There are however additional points that have to be taken into consideration before executing the resize operation. 1. Is the original disk going to be expanded?
2. Is it possible to add a new disk to expand the existing btrfs file system?

  
The following article will cover a situation with one disk and two partitions to show the steps necessary for both scenarios using both offline as well as online resize operation.  
  
Please keep in mind that a more sophisticated partitioning scheme (partitions behind the root volume or an extended partition layout) may cause problems. In these cases adding a new disk to expand the existing file system is the preferred solution.  
  
Please check the system setup carefully before carrying out any actions.  
  
**Because the procedures covered in this article contain a fair risk of losing the operating system while performing changes to the partition table, the administrator of the machine is required to create a backup before the operation!  
  
This guide does not claim to be complete or cover all possible scenarios. In case of questions please open a service request to discuss these with SUSE Technical Services before any action is taken.**</div></div></div></div></div></div></div></div></div>### Resolution

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><u>**Situation:**</u>  
  
The disk space of a virtual system with 20GB hard disk should be increased to 40GB.  
  
<u>**Preparation:**</u>1. Since the following procedure requires changes to the partition table, a loss of data is possible. Please ensure to create a backup of the system before performing any action!
2. Ensure your restore procedure works correctly!
3. Check carefully if a <span style="font-family: Courier New,Courier,monospace;">MSDOS</span> or <span style="font-family: Courier New,Courier,monospace;">GPT</span> partition table was created. This information can easily be obtained from the <span style="font-family: Courier New,Courier,monospace;">parted -l </span>/ <span style="font-family: Courier New,Courier,monospace;">fdisk -l</span> output easily.

<div style="margin-left: 40px;">**Note**: Only parted is able to edit <span style="font-family: Courier New,Courier,monospace;">GPT</span> partition table. If a <span style="font-family: Courier New,Courier,monospace;">GPT</span> partition table is used, an online resize is not possible as parted uses the <span style="font-family: Courier New,Courier,monospace;">BLKRRPART</span> ioctl which prevents changes while the partition is mounted.</div>  
This article is going to cover the following three approaches to accomplish the resize of a virtual disk in a VMware based environment: 1. [Expanding the file system by adding a new disk](https://www.suse.com/support/kb/doc/?id=000018798#Expanding-the-file-system-by-adding-a-new-disk)
2. [Resizing the disk using parted](https://www.suse.com/support/kb/doc/?id=000018798#Resizing-using-parted)
3. [Resizing the disk online using fdisk](https://www.suse.com/support/kb/doc/?id=000018798#with-fdisk)

  
  
<u>**<a id="bkmrk--0" name="Expanding-the-file-system-by-adding-a-new-disk"></a>Expanding the file system by adding a new disk** </u>  
  
A convenient and quick solution to add disk space to an existing btrfs file system is by adding a new disk.  
The procedure consists of four steps and the system does not need to be rebooted: 1. add a new disk
2. rescan the SCSI bus using

<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
rescan-scsi-bus.sh -a
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>3. Add the newly added device to the root btrfs filesystem

<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
btrfs device add /dev/sdX /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>4. At this point the metadata is only stored on the first disk, to distribute (balance) it across the devices run:

<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem balance /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
  
<a id="bkmrk--1" name="Resizing-using-parted"></a><u>**Resizing the disk using parted**</u>  
 </div></div></div></div></div></div></div></div></div></div>```
server1:~ # parted -l
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  4302MB  4301MB  primary  linux-swap(v1)  type=82
 2      4302MB  21.5GB  17.2GB  primary  btrfs           boot, type=83
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content">  
As a first step, the virtual disk needs to be increased on the hypervisor side. Please refer to the vendor documentation for this particular task. The <span style="font-family: Courier New,Courier,monospace;">parted -l</span> output above also provides the information whether a <span style="font-family: Courier New,Courier,monospace;">MSDOS</span> or <span style="font-family: Courier New,Courier,monospace;">GPT</span> partition label was used. <span style="font-family: Courier New,Courier,monospace;">fdisk -l</span> (an example is provided in the section [<u>**Resizing the partition online using fdisk**</u>](https://www.suse.com/support/kb/doc/?id=000018798#with-fdisk) ) will show this information.  
  
Once this has been accomplished, rescan the local disk:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # echo 1 > /sys/block/sda/device/rescan
server1:~ # parted -l
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

    Number  Start   End     Size    Type     File system     Flags
    1      1049kB  4302MB  4301MB  primary  linux-swap(v1)  type=82
    2      4302MB  21.5GB  17.2GB  primary  btrfs           boot, type=83
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>The OS now sees the new size of the disk but the partitioning layout needs to be changed to add the remaining 20GB to <span style="font-family: Courier New,Courier,monospace;">/dev/sda2</span>.  
Trying to resize <span style="font-family: Courier New,Courier,monospace;">/dev/sda </span>using parted will fail with:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resize
Partition number? 2
Error: Partition /dev/sda2 is being used. You must unmount it before you modify it with Parted.
 (parted)
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>Trying to accomplish the same task in <span style="font-family: Courier New,Courier,monospace;">yast2 disk</span> fails with:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
Warning
The file system is currently mounted on /.

You can try to unmount it now, continue without unmounting or cancel.
Click Cancel unless you know exactly what you are doing.
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>Hence this task needs to be accomplished in the rescue system. Please boot from the Service Pack DVD matching the installed SLES version and select "Rescue System" from the main menu. As of SLE 12 SP2, the Rescue System option is located in the "More ..." menu.  
Once the rescue system has started, the disk resize operation may be performed as follows:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
0:rescue:~ # parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resize
Partition number? 2
End?  [21.5GB]? 42.5GB
(parted) quit
Information: You may need to update /etc/fstab.
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
Running <span style="font-family: Courier New,Courier,monospace;">parted -l </span>will show the new end of the partition:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
0:rescue:~ # parted -l
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

    Number  Start   End     Size    Type     File system     Flags
    1      1049kB  4302MB  4301MB  primary  linux-swap(v1)  type=82
    2      4302MB  42.5GB  38.2GB  primary  btrfs           boot, type=83
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>The last steps are to mount the partition and resize the btrfs file system (example below). (If the btrfs file system resides on multiple devices, see the Additional Information section of this document, as well.) <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
0:rescue:~ # mount /dev/sda2 /mnt
0:rescue:~ # btrfs filesystem resize max /mnt
Resize '/mnt' of 'max'

0:rescue:~ # df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0       29M   29M     0 100% /parts/mp_0000
/dev/loop1       14M   14M     0 100% /parts/mp_0001
devtmpfs        468M     0  468M   0% /dev
/dev/loop2       42M   42M     0 100% /mounts/mp_0000
/dev/loop3       34M   34M     0 100% /mounts/mp_0001
/dev/loop4      4.2M  4.2M     0 100% /mounts/mp_0002
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           497M  7.2M  490M   2% /run
tmpfs           497M     0  497M   0% /sys/fs/cgroup
tmpfs           497M     0  497M   0% /tmp
tmpfs           100M     0  100M   0% /run/user/0
/dev/sda2        36G  753M   33G   3% /mnt
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>Reboot the system back into operation.  
  
<a id="bkmrk--2" name="with-fdisk"></a><u>**Resizing the partition online using fdisk**</u>  
  
<span style="font-family: Courier New,Courier,monospace;">fdisk</span> does not support resizing a partition. In this case the existing root partition needs to be deleted and recreated using the same start block but selecting the new end block to assign all available disk space to the partition.  
As already mentioned before, <span style="font-family: Courier New,Courier,monospace;">fdisk</span> cannot deal with <span style="font-family: Courier New,Courier,monospace;">GPT</span> partition tables. Please check carefully which label was chosen and select the right tool for the resize operation.  
  
When recreating the partition please make sure to set the bootable flag again, otherwise the system will not boot.  
The procedure using <span style="font-family: Courier New,Courier,monospace;">fdisk</span> is as follows:  
  
Print the current partition table, save it, expand the disk, have the kernel rescan the device and make sure it sees the new size:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004a8ed

Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1          2048  8402943  8400896   4G 82 Linux swap / Solaris
/dev/sda2  *    8402944 41943039 33540096  16G 83 Linux
btrfs:~ # echo 1 > /sys/block/sda/device/rescan
btrfs:~ # fdisk -l
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004a8ed

Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1          2048  8402943  8400896   4G 82 Linux swap / Solaris
/dev/sda2  *    8402944 41943039 33540096  16G 83 Linux
server1:~ #
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
**Keep in mind, operations in fdisk are temporary until a write operation is issued. So at any point it is safe to exit fdisk using CTRL+c.**  
  
As a next step open fdisk and delete the root partition. <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # fdisk /dev/sda

Welcome to fdisk (util-linux 2.28).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>Now recreate partition #2 as a primary partition with partition ID 83 (Linux partition)  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2):
First sector (8402944-83886079, default 8402944):
Last sector, +sectors or +size{K,M,G,T,P} (8402944-83886079, default 83886079):

Created a new partition 2 of type 'Linux' and of size 36 GiB.

Command (m for help): t
Partition number (1,2, default 2): 2
Partition type (type L to list all types): 83

Changed type of partition 'Linux' to 'Linux'.
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>As shown above, <span style="font-family: Courier New,Courier,monospace;">fdisk</span> picked up the correct start and end block by itself. The next step is to enable the boot-flag:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
Command (m for help): a
Partition number (1,2, default 2): 2
The bootable flag on partition 2 is enabled now.
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>After the changes above, the new partition table will be as follows:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
Command (m for help): p
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004a8ed

Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1          2048  8402943  8400896   4G 82 Linux swap / Solaris
/dev/sda2  *    8402944 83886079 75483136  36G 83 Linux
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
Now, while writing the changes to disk, the following messages will be shown: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

server1:~ # partprobe
Error: Partition(s) 2 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
Error: Can't have a partition outside the disk!
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>SLES 11 SP4 based systems need to be rebooted at this point as the kernel does not support re-reading the partition table using <span style="font-family: Courier New,Courier,monospace;">BLKPG\_DEL\_PARTITION</span> and <span style="font-family: Courier New,Courier,monospace;">BLKPG\_RESIZE\_PARTITION</span> ioctls.  
Once the system is back online please run:   
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem resize max /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>to expand the file system. (If the btrfs file system resides on multiple devices, see the Additional Information section of this document, as well.)  
  
SLE 12 based systems support the ioctls mentioned previously, this way it is possible to notify the kernel about the changed partition table as the system is online.  
  
Old partition table: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # fdisk -l /dev/sda
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000dd878

Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1          2048  8402943  8400896   4G 82 Linux swap / Solaris
/dev/sda2  *    8402944 41943039 33540096  16G 83 Linux
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
Execute the actions as displayed above to remove and recreate the partition table, write the changes and receive the busy message from the kernel: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # fdisk -l
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000dd878

Device     Boot   Start       End  Sectors Size Id Type
/dev/sda1          2048   8402943  8400896   4G 82 Linux swap / Solaris
/dev/sda2  *    8402944 104857599 96454656  46G 83 Linux
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>So <span style="font-family: Courier New,Courier,monospace;">/dev/sda2</span> was resized from 20GB to 50GB, check the kernel's view on the partitions:  
<div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # cat /proc/partitions
major minor  #blocks  name

   2        0          4 fd0
   8        0   52428800 sda
   8        1    4200448 sda1
   8        2   <strong>16770048</strong> sda2
  11        0    1048575 sr0
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>now update the kernel's view of <span style="font-family: Courier New,Courier,monospace;">/dev/sda2</span> using: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
partx -u -n 2 /dev/sda
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
 </div>and check the partitions again: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
server1:~ # cat /proc/partitions
major minor  #blocks  name

   2        0          4 fd0
   8        0   52428800 sda
   8        1    4200448 sda1
   8        2   <strong>48227328</strong> sda2
  11        0    1048575 sr0
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>  
Now resize the filesystem. (If the btrfs file system resides on multiple devices, see the Additional Information section of this document, as well.) <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem resize max /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>Running: <div style="margin-left: 40px;">  
</div></div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem usage /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><div style="margin-left: 40px;">  
</div>will now show the new size of the filesystem.  
  
Using <span style="font-family: Courier New,Courier,monospace;">partx</span> it would also be possible to delete any partitions that are not needed behind the root volume, expand the root volume, delete the kernel view on that partition (<span style="font-family: Courier New,Courier,monospace;">partx -d -n X /dev/sda</span>), update the root partition (<span style="font-family: Courier New,Courier,monospace;">partx -u -n X /dev/sda</span>) and then resize the filesystem.</div></div></div></div></div></div></div></div></div>### Additional Information

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content"><u>**Considerations when adding new devices into a btrfs file system**</u>  
  
Another possible method to extend the disk space of a btrfs file system would be to add unused partitions from a disk. Please note that btrfs will treat these partitions (even if they come from the same device) as a separate physical volume and if later the file system should operate in RAID mode, chunks will be served from both partitions which is not desirable. In this case it is preferable to either add complete disks or delete unused partitions and resize the root volume where applicable.  
  
<u>**If the btrfs file system resides on multiple devices**</u>  
  
When a btrfs file system resides on mulitple devices, first determine the devid of resized partition, for example:</div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem show /
```

<div class="container-fluid support-document"><div class="container-fluid support-document"><div class="container-fluid support-document"><div class="row"><div class="standard-pad white-bg"><div><div><div><div class="col_one"><div class="content">That will list all partitions in use, and number them. Then, for example, if the partition in question is devid 2, the appropriate command is:</div></div></div></div></div></div></div></div></div></div>```
btrfs filesystem resize 2:max /
```

</main>