SWAP create: различия между версиями
Перейти к навигации
Перейти к поиску
Sol (обсуждение | вклад) |
Sol (обсуждение | вклад) |
||
(не показано 5 промежуточных версий этого же участника) | |||
Строка 2: | Строка 2: | ||
== ext4 == | == ext4 == | ||
− | + | 4G swafile | |
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="bash"> |
fallocate -l 4G /swapfile | fallocate -l 4G /swapfile | ||
chmod 600 /swapfile | chmod 600 /swapfile | ||
mkswap /swapfile | mkswap /swapfile | ||
swapon /swapfile | swapon /swapfile | ||
− | echo '/swapfile | + | echo '/swapfile swap swap defaults 0 0' >> /etc/fstab |
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | fallocate -l 2G /swapfile; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile; echo '/swapfile swap swap defaults 0 0' >> /etc/fstab | ||
+ | </syntaxhighlight> | ||
+ | |||
== xfs == | == xfs == | ||
− | + | 1G swapfile | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
dd if=/dev/zero of=/swapfile bs=1024 count=1048576 | dd if=/dev/zero of=/swapfile bs=1024 count=1048576 | ||
Строка 19: | Строка 24: | ||
swapon /swapfile | swapon /swapfile | ||
echo '/swapfile none swap sw 0 0' >> /etc/fstab | echo '/swapfile none swap sw 0 0' >> /etc/fstab | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | dd if=/dev/zero of=/swapfile bs=2048 count=1048576; chown root:root /swapfile; chmod 0600 /swapfile; mkswap /swapfile; swapon /swapfile; echo '/swapfile none swap sw 0 0' >> /etc/fstab | ||
</syntaxhighlight> | </syntaxhighlight> |
Текущая версия на 12:10, 26 февраля 2019
ext4
4G swafile
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab
fallocate -l 2G /swapfile; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile; echo '/swapfile swap swap defaults 0 0' >> /etc/fstab
xfs
1G swapfile
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
chown root:root /swapfile
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
dd if=/dev/zero of=/swapfile bs=2048 count=1048576; chown root:root /swapfile; chmod 0600 /swapfile; mkswap /swapfile; swapon /swapfile; echo '/swapfile none swap sw 0 0' >> /etc/fstab