diff --git a/wiki/linux/disk-management.md b/wiki/linux/disk-management.md index eecedeb..dba33ee 100644 --- a/wiki/linux/disk-management.md +++ b/wiki/linux/disk-management.md @@ -1,6 +1,6 @@ # Disk Management -This article focusses on non-LVM and non-MDADM storage. +This article focusses on non-LVM and non-MDADM storage including swap. For [LVM](lvm.md), [NTFS](./ntfs.md), [Samba](./samba.md), [MDADM](./mdadm.md) and [LUKS volumes](./dm-crypt.md) there are separate entries. @@ -8,6 +8,36 @@ are separate entries. This section focusses on various usages for disk management related topics. +### Increasing Swap File Size + +The size of a swap file can easily be increased using the following steps. +Using the following commands currently active swaps can be shown and the usage of them can be +checked. + +```sh +swapon --show +free -h +``` + +Then the swap file can be changed using the following commands. +`` is the location of the swap file (for example `/swap.img`). +`` describes the new size of the swap file (for example `16G`) + + +```sh +swapoff +fallocate -l +chmod 600 +mkswap +swapon +``` + +Finally the swap can be checked again to confirm that it is online and has the correct size + +```sh +swapon --show +``` + ### Benchmarking Data Transfer Rates Real data transfer rates can easily be checked using the program `pv`.