LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2024, 04:32 PM   #1
eurusd
LQ Newbie
 
Registered: Sep 2009
Posts: 7

Rep: Reputation: 0
make swap bigger on luks?


how to make a swap bigger on luks?
by default it is only 2 GB
I want 16GB swap


cat /etc/crypttab
nvme0n1p3_crypt UUID=5453a2d7-a805-4c46-8830-1b40b4e0820b none luks,discard
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vgkubuntu-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/nvme0n1p2 during installation
UUID=6e64ffd7-9479-49aa-924e-189f61ea1158 /boot ext4 defaults 0 2
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=E1D2-69BA /boot/efi vfat umask=0077 0 1
/dev/mapper/vgkubuntu-swap_1 none swap sw 0 0

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 373.8M 1 loop /snap/anbox/186
loop2 7:2 0 105.4M 1 loop /snap/core/16574
loop3 7:3 0 104M 1 loop /snap/core/16928
loop4 7:4 0 63.9M 1 loop /snap/core20/2182
loop5 7:5 0 63.9M 1 loop /snap/core20/2264
loop6 7:6 0 74.1M 1 loop /snap/core22/1033
loop7 7:7 0 74.2M 1 loop /snap/core22/1122
loop8 7:8 0 267.5M 1 loop /snap/firefox/3941
loop9 7:9 0 268.3M 1 loop /snap/firefox/4090
loop10 7:10 0 349.7M 1 loop /snap/gnome-3-38-2004/140
loop11 7:11 0 349.7M 1 loop /snap/gnome-3-38-2004/143
loop12 7:12 0 497M 1 loop /snap/gnome-42-2204/141
loop13 7:13 0 504.2M 1 loop /snap/gnome-42-2204/172
loop14 7:14 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop15 7:15 0 103.2M 1 loop /snap/pac-vs/1
loop16 7:16 0 147M 1 loop /snap/shotcut/1389
loop17 7:17 0 40.4M 1 loop /snap/snapd/20671
loop18 7:18 0 39.1M 1 loop /snap/snapd/21184
loop19 7:19 0 417.9M 1 loop /snap/telegram-desktop/5783
loop20 7:20 0 417.9M 1 loop /snap/telegram-desktop/5791
loop21 7:21 0 310.8M 1 loop
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1.7G 0 part /boot
└─nvme0n1p3 259:3 0 951.7G 0 part
└─nvme0n1p3_crypt 252:0 0 951.7G 0 crypt
├─vgkubuntu-root 252:1 0 929.4G 0 lvm /var/snap/firefox/common/host-hunspell
│ /
└─vgkubuntu-swap_1 252:2 0 1.9G 0 lvm [SWAP]


Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 2.6M 1.6G 1% /run
/dev/mapper/vgkubuntu-root 914G 325G 543G 38% /
tmpfs 7.7G 298M 7.4G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
efivarfs 246K 108K 134K 45% /sys/firmware/efi/efivars
/dev/nvme0n1p2 1.7G 301M 1.3G 20% /boot
/dev/nvme0n1p1 511M 6.1M 505M 2% /boot/efi
tmpfs 1.6G 108K 1.6G 1% /run/user/1000

Last edited by eurusd; 04-15-2024 at 05:05 PM.
 
Old 04-15-2024, 04:57 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
LUKS is irrelevant in this context. Reduce the root lv (and filesystem of course) - then you have a couple of choices:
- delete and reallocate the swap lv, making sure to use the same UUID
- or add a new lv for a second swap extent.
 
Old 04-15-2024, 05:32 PM   #3
eurusd
LQ Newbie
 
Registered: Sep 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
LUKS is irrelevant in this context. Reduce the root lv (and filesystem of course) - then you have a couple of choices:
- delete and reallocate the swap lv, making sure to use the same UUID
- or add a new lv for a second swap extent.
how to do it?
 
Old 04-16-2024, 12:08 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Why do you think you need bigger swap ?.
 
Old 04-16-2024, 03:00 AM   #5
lvm_
Member
 
Registered: Jul 2020
Posts: 932

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
You can (and should) allocate extra swap as plain filesystem files and you can add as many as you like as described e.g. here https://docs.oracle.com/cd/E24457_01...988/giprn.html Storing swap on separate partitions or volumes is a dated approach.
 
Old 04-16-2024, 04:59 PM   #6
eurusd
LQ Newbie
 
Registered: Sep 2009
Posts: 7

Original Poster
Rep: Reputation: 0
sudo swapon -s
sudo swapoff /dev/dm-2
sudo fallocate -l 16g /swapfile
chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

nano /etc/fstab
/swapfile none swap sw 0 0

*solved*
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 'This was bigger than GNOME and bigger than just this case.' GNOME Foundation exec director talks patent trolls and much, much more LXer Syndicated Linux News 0 10-24-2020 04:21 AM
/proc/kcore file is getting bigger and bigger. thewhitelion Ubuntu 2 03-07-2008 09:50 AM
size gets bigger and bigger alaios Linux - General 1 07-22-2004 10:18 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Sampling bits of information in bigger and bigger pieces lugoteehalt General 0 10-29-2003 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration