mirror of
https://github.com/tiyn/wiki.git
synced 2025-11-26 21:29:46 +01:00
linux: added swap file resizing
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Disk Management
|
# 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
|
For [LVM](lvm.md), [NTFS](./ntfs.md), [Samba](./samba.md), [MDADM](./mdadm.md) and [LUKS volumes](./dm-crypt.md) there
|
||||||
are separate entries.
|
are separate entries.
|
||||||
|
|
||||||
@@ -8,6 +8,36 @@ are separate entries.
|
|||||||
|
|
||||||
This section focusses on various usages for disk management related topics.
|
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.
|
||||||
|
`<location>` is the location of the swap file (for example `/swap.img`).
|
||||||
|
`<size>` describes the new size of the swap file (for example `16G`)
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
swapoff <location>
|
||||||
|
fallocate -l <size> <location>
|
||||||
|
chmod 600 <location>
|
||||||
|
mkswap <location>
|
||||||
|
swapon <location>
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
### Benchmarking Data Transfer Rates
|
||||||
|
|
||||||
Real data transfer rates can easily be checked using the program `pv`.
|
Real data transfer rates can easily be checked using the program `pv`.
|
||||||
|
|||||||
Reference in New Issue
Block a user