[SOLVED] changes to swap partition
I didn't think my current partition set up through properly on install so I'd like to make some changes. Swap seems to be the obvious candidate as it doesn't involve messing with data. Does this plan sound like it will work or be a disaster?
1. swapoff -a
2. Run cfdisk, delete the swap partition, create an extended partition, format a swap partition in there with the same sdaX designation as it has now, add whatever other partitions are needed to the extended partition. Write the new partition table.
3. swapon -L /dev/sdaX
Do I need to edit fstab afterwards to ensure a later swapon -a doesn't cause problems?
Last edited by tasticorp (2011-11-01 15:51:43)
Sounds like it could work although you will need to edit fstab as sda4 will become the extended partition (and don't forget to add your new partitions to fstab if you want them mounted on boot)
You may want to use UUIDs though (see this wiki article: https://wiki.archlinux.org/index.php/Pe … ce_naming).
mkswap -U <uuid> /dev/sdaX
will give you a swap partition with a UUID of your choice. I found this, in combination with blkid, to be easier than editing fstab
Similar Messages
-
[SOLVED] Please verify: swap partition needed for dm-crypt/LUKS??
Hi,
Can anyone confirm whether or not the following is accurate (from http://wiki.archlinux.org/index.php/Sys … artitions)
There are 3 required partitions for any encrypted system:
- The root file system: /
- The initial boot partition: /boot
- The swap partition: swap
Do I need a swap partition if I encrypt? I can't seem to find reference to swap being mandatory anywhere else.
Last edited by jwhendy (2010-10-12 13:27:12)You don't need swap. The minimal required setup is having two partitions: boot and root, where /boot must not be encrypted and / can be encrypted.
Last edited by stfn (2010-10-12 12:45:22) -
[SOLVED] Change swap partition type code
Hello,
I get error on getting my swap to work because I have it configured in fstab and systemd also automatically picks it up. According to the wiki https://wiki.archlinux.org/index.php/sw … by_systemd I can either remove my fstab entry or change the partition type code.
Guide me what I shall read up on in order to change my swap partition type code - so far I dont quite follow what is relevant in my searches.
Regards
Martin
Last edited by onslow77 (2015-02-19 21:52:50)Hello,
I see, the type code is the same as the system id for the partition, so I can use fdisk for MBR and gptdisk for GPT.
Regards
Martin
Last edited by onslow77 (2015-02-19 20:41:10) -
[Solved] Do I need a swap partition /swap file?
Hello Arch Community.
I want to install Arch Linux on my Aspire V5-573G Notebook with 8GB RAM and a 120GB 840 Evo SSD from Samsung. So my question is, do I actually need a swap partition / swap file? I read the arch-wiki pages about swap and suspend-to-disk / suspend-to-ram, and the only thing thats obviously profiting from / needing a swap partition is suspend-to-disk, no other things are mentioned in this regard. Is a swap partition in any other way important?
Thanks in advance.
Last edited by Oedner (2013-12-21 12:41:19)headkase wrote:Another question to ask is what will happen if you don't have a swap file and run out of memory? In that case the Linux kernel will randomly kill process' until there is enough memory again. Obviously that isn't very stable but that is what it will do.
No. The OOM killer is pretty darn tweaked these days and usually(!) kills the actual perpetrator. The alternative—disabling memory overcommitting and answering memory requests with an out-of-memory error—can result in unforeseen problems as well: What if it a system process is trying to allocate a few bytes for some random string, and what if said system process isn't equipped to handle ENOMEM gracefully and crashes, because the default policy on Linux is to overcommit and never answer with out-of-memory errors?
Just trying to play devil's advocate here. I'm not happy with the OOM killer either and I'd rather have a deterministic solution to out-of-memory situations, but I realize that it's probably not an easy problem to solve. -
[Solved]Can I install arch without a swap partition ?
I only have one primary partition free to install arch, with 3 primary partition and 1 extend partition, I have no other choice except install without swap partition.
Is there any suggestion? I will try it until I get a U storage to write .img in.
Last edited by sailor (2009-03-17 00:47:31)Sure, it's perfectly possible to use any linux system without swap. including arch.
There are 2 ways to do disk partitioning in /arch/setup:
1) autoprepare. with this method, you pick a disk (a disk you want to use entirely). you will be asked some questions (including how big swap should be). this method will create the partitions with the sizes you mention (/boot, swap, / and /home) optionally you can add additional fs'es
2) manual. the installer can launch cfdisk for you if you need to alter partitions (if you want this), and after that you can define pretty much your stuff the way you like it (eg no swap) iirc. i'm not 100% sure though.
Frankly I don't understand why you say "I have no choice", if you don't have enough partitions, you can always create additional ones. -
[SOLVED] Virtual Memory Exhausted with unused 16g Swap Partition.
Hello all, long time reader, first time poster. So basically what I'm running into is that I'm having Virtual Memory Exhausted errors with various programs even though I have a 16g swap partition mounted. I've manually enabled it to try it as well. Here's some outputs to give you an idea of how my system is set up. It's a UEFI fresh install, only a couple days old.
fstab:
# /etc/fstab: static file system information
# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid 0 0
# /dev/sdb3
UUID=ea7a0311-6314-4215-b98d-7360552b28c4 / ext4 rw,relatime,data=ordered 0 1
# /dev/sdc3
UUID=8f6f2006-3a9c-4563-a149-547d758e2af1 /home ext4 rw,relatime,data=ordered 0 2
# /dev/sdb2
UUID=baf1ba80-ddf3-4cbb-a13e-b81a0af0a9e7 /boot ext4 rw,relatime,data=ordered 0 2
# /dev/sdb1
UUID=2B46-5340 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
# /dev/sdc1
UUID=4336d783-c289-4fbf-8c59-f1a1da782130 /var ext4 rw,relatime,data=ordered 0 2
# /dev/sdc2
UUID=96a60f08-a57f-42f1-80ff-846d02a29199 /var/log ext4 rw,relatime,data=ordered 0 2
# /dev/sda2
UUID=c5d5879a-b0e8-4976-8057-2f95975a1251 /share ext4 rw,relatime,data=ordered 0 2
# /dev/sdb4
UUID=6e6277c4-a69a-4838-83cd-c206959acf0e /store ext4 rw,relatime,data=ordered 0 2
#swap
UUID=21a56b10-85e5-48a1-91e5-995eae0dfba4 none swap defaults 0 0
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 16G 0 part [SWAP]
└─sda2 8:2 0 915.5G 0 part /share
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 1G 0 part /boot/efi
├─sdb2 8:18 0 1G 0 part /boot
├─sdb3 8:19 0 50G 0 part /
└─sdb4 8:20 0 879.5G 0 part /store
sdc 8:32 0 931.5G 0 disk
├─sdc1 8:33 0 20G 0 part /var
├─sdc2 8:34 0 2G 0 part /var/log
└─sdc3 8:35 0 909.5G 0 part /home
sr0 11:0 1 1024M 0 rom
cat /proc/meminfo
MemTotal: 12256600 kB
MemFree: 9926584 kB
Buffers: 212588 kB
Cached: 774636 kB
SwapCached: 0 kB
Active: 1179860 kB
Inactive: 638584 kB
Active(anon): 831604 kB
Inactive(anon): 14480 kB
Active(file): 348256 kB
Inactive(file): 624104 kB
Unevictable: 4 kB
Mlocked: 4 kB
SwapTotal: 16777212 kB
SwapFree: 16777212 kB
Dirty: 32 kB
Writeback: 0 kB
AnonPages: 831320 kB
Mapped: 196008 kB
Shmem: 14892 kB
Slab: 345008 kB
SReclaimable: 316620 kB
SUnreclaim: 28388 kB
KernelStack: 2616 kB
PageTables: 27032 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 22905512 kB
Committed_AS: 3365808 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 357936 kB
VmallocChunk: 34359373819 kB
HardwareCorrupted: 0 kB
AnonHugePages: 86016 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 117756 kB
DirectMap2M: 4059136 kB
DirectMap1G: 8388608 kB
swapon -s
Filename Type Size Used Priority
/dev/sda1 partition 16777212 0 -1
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 94832
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 94832
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
I did just notice that it's showing 4gb less RAM than there should be (12 instead of 16, I'll be checking into that about the same time I hit submit) but as far as I can tell the system shouldn't even be worried about swap 99.99% of the time. Any ideas?
Edit: On reboot system show the full 16gb of RAM.
Last edited by inquisitorthreefive (2012-11-19 07:44:32)inquisitorthreefive wrote:
I did just notice that it's showing 4gb less RAM than there should be (12 instead of 16, I'll be checking into that about the same time I hit submit) but as far as I can tell the system shouldn't even be worried about swap 99.99% of the time. Any ideas?
Edit: On reboot system show the full 16gb of RAM.
Could it be a hardware problem with RAM? Is there a 4 GB RAM chip in the machine that may have failed? -
[SOLVED] Swap Partition keeps being automounted, but it shouldn't.
Hi,
I created a swap partition as part of setting up a Linux From Scratch installation, and it was intended for that system only. However it is automounted every time I boot my arch.
It is neither mentioned in my fstab or my mtab. I tried # swapoff , and that disables it for that instance, but after boot it's mounted again. Tried giving it an fstab entry with the noauto option.
Last edited by krork (2015-01-05 18:11:24)Thanks Guys!
I have not yet found a way to stop systemd from automounting the swap partition. I'm a bit busy this January. However, as a workaround I created a swapoff.service file in /etc/systemd/system with this content:
[Unit]
Description=Turns off Swap Partition
DefaultDependencies=no
After=getty.target
[Service]
ExecStart=/usr/bin/swapoff /dev/sdaX
[Install]
WantedBy=multi-user.target
Replace the /dev/sdaX with your according partition, of course.
Edit: Also you'll want to enable it: # systemctl enable swapoff.service
So in case anyone else is having this problem and just wants a dirty fix, this worked for me, for now. If I find out how to keep systemd from automounting in the first place I'll let you know.
Last edited by krork (2015-01-05 16:50:33) -
SWAP partition (Hibernate Failure)[SOLVED]
Hi Folks,
My suspend to disk (Hibernate) is not working. When I boot up my pc, it starts processing. In meanwhile, I can see the output on my screen. At some point, it starts checking mounted filesystems
"Checking Filesystems"
/dev/sda1
dev/sda3
/dev/sda4
I do not know why this skips /dev/sda2 which is my swap partition actually.
After three or four lines, I can see from the output saying "Activating Swap". Does it mean that my swap partition is configured correctly or not?
There is one more thing. I use gnome. In gnome, when I open System Monitor (from the panel) > and under File Systems, I also can not see my swap partition which is /dev/sda2 while I can see all other partitions which are /, /boot, /home.
Does it mean that the partition can not be mounted correctly.
I really appreciate any kind of help.
Thanks in advance.
Last edited by Archie_Enthusiasm (2010-11-28 15:49:30)Here is the output:
cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 6297476 0 -1
free -m
total used free shared buffers cached
Mem: 3013 1182 1830 0 58 532
-/+ buffers/cache: 591 2421
Swap: 6149 0 6149
It says that the swap is being used. But when I hibernate my pc, it correctly shuts itself down. But when I wake up the pc again, it says at the boot time that my / , /root, /boot mount file systems were not unmounted correctly and starts checking the filesystems (Some kind of journaling process starts). When it boots up, the stored session is no more there or existent anymore. It is like as I forced the system to shutdown and start it again (Just like as there were a system freeze and then I did shutdown the system by pressing the power button for more than 10 secs and then restarted). So I suspect that the system did not shutdown correctly even if there were no strange occurrence happening when I did the hibernate.
I hope someone can help me. If you need some more information about the configuration on my pc, please tell me command and I will post the output.
Thanks in advance
Last edited by Archie_Enthusiasm (2010-10-28 21:41:58) -
[SOLVED] Init - Activating Swap (Failed)
I just updated my system,
and after a recent reboot i noticed the init trying to activate swap, and failing.
Thing is, i don't use a swap partition, and hasn't since i installed Arch on this machine,
But i don't remember it (init, udev or the recent kernel?) trying anyways.
This is not causing any problems from what i can see,
but for sake of tidiness, what has changed,
and shouldn't it - not even try - activating a swap partition when one is not set and/or existing at all?
/etc/fstab:
# /etc/fstab: static file system information
# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid 0 0
UUID=02709134-c074-4e66-8aa6-ed2d43a1cdf4 / ext4 defaults,noatime 0 1
UUID=d4b8ac62-9fb2-4798-9ff3-d3e179ff253e /home ext4 defaults,noatime 0 1
/dev/sda2 /mnt/win7 ntfs-3g defaults 0 0
/dev/sda4 /mnt/wind ntfs-3g defaults 0 0
/dev/sdb2 /mnt/winf ntfs-3g defaults 0 0
/dev/sdc1 /mnt/wine ntfs-3g defaults 0 0
/dev/sdc2 /mnt/wint ntfs-3g defaults 0 0
/dev/sdd1 /mnt/wing ntfs-3g defaults,noauto,nofail 0 0
Last edited by PReP (2012-03-10 11:22:30)It might actually be.
I just found that a few of my non-UUID mounted partitions had switched around,
Probably because of my switch to AHCI instead of Legacy-IDE in the BIOS yesterday.
When i fixed them, "Activating Swap" went "[DONE]" again, though i still have no swap partition
- but that is what it might have said before aswell, thus it was just the "[FAILED]" that caught my eye.
I found this quote in the thread skunktrader linked, that might explain this partially:
"TomeGun: There was recently a bug report about this (against util-linux-2.21-1). It turned out that the problem was actually that mounting local filesystems mistakenly printed FAILED, even though it succeeded. "
I should probably leave this as solved at this time,
Thanks to the community for sharing ideas, as usual -
[Solved] encryption of swap with cryptsetup doesn't work
Hi,
I reinstalled my because of new hardware with EFI and GPT, and now I can't get work my swap partition encrypted.
/etc/cryptsetup:
cryptswap /dev/sda1 /dev/urandom swap
Also with more options (key-length, etc) doesn't change the behavior.
/etc/fstab:
ABEL=system / ext4 rw,relatime,data=ordered 0 1
/dev/sda128 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
/dev/mapper/cryptswap none swap sw 0 0
I tried also without any swap-entry in the /etc/fstab, because my pam_mounted LUKS-encrypted Partitions are working well, without a fstab-entry
Here is the journald-output that might be relevant:
Feb 09 01:25:41 dixi-arch systemd[1]: Found device Hitachi_HDP725025GLA380.
Feb 09 01:25:41 dixi-arch systemd[1]: Activating swap /dev/sda1...
Feb 09 01:25:41 dixi-arch systemd[1]: Starting Cryptography Setup for cryptswap...
Feb 09 01:25:41 dixi-arch kernel: tda829x 0-004b: type set to tda8290+75a
Feb 09 01:25:41 dixi-arch systemd[1]: Activated swap /dev/sda1.
Feb 09 01:25:41 dixi-arch kernel: Adding 2097148k swap on /dev/sda1. Priority:-1 extents:1 across:2097148k FS
Feb 09 01:25:42 dixi-arch kernel: device-mapper: uevent: version 1.0.3
Feb 09 01:25:42 dixi-arch kernel: device-mapper: ioctl: 4.26.0-ioctl (2013-08-15) initialised: [email protected]
Feb 09 01:25:42 dixi-arch systemd-cryptsetup[251]: Set cipher aes, mode cbc-essiv:sha256, key size 256 bits for device /dev/sda1.
Feb 09 01:25:42 dixi-arch systemd-cryptsetup[251]: Failed to activate with key file '/dev/urandom': Device or resource busy
Feb 09 01:26:16 dixi-arch systemd-cryptsetup[251]: Loading of cryptographic parameters failed: Invalid argument
Feb 09 01:26:16 dixi-arch systemd-cryptsetup[251]: Failed to activate: Invalid argument
Feb 09 01:26:16 dixi-arch systemd[1]: [email protected]: main process exited, code=exited, status=1/FAILURE
Feb 09 01:26:16 dixi-arch systemd[1]: Failed to start Cryptography Setup for cryptswap.
Feb 09 01:26:16 dixi-arch systemd[1]: Dependency failed for Encrypted Volumes.
Feb 09 01:26:16 dixi-arch systemd[1]: Dependency failed for dev-mapper-cryptswap.device.
Feb 09 01:26:16 dixi-arch systemd[1]: Dependency failed for /dev/mapper/cryptswap.
Feb 09 01:26:16 dixi-arch systemd[1]: Dependency failed for Swap.
Feb 09 01:26:16 dixi-arch systemd[1]: Unit [email protected] entered failed state.
Feb 09 01:26:16 dixi-arch systemd[1]: Starting System Initialization.
Feb 09 01:26:35 dixi-arch systemd-cryptsetup[602]: Key file /dev/urandom is world-readable. This is not a good idea!
Feb 09 01:26:35 dixi-arch systemd-cryptsetup[602]: Set cipher aes, mode cbc-essiv:sha256, key size 256 bits for device /dev/sda1.
Feb 09 01:26:35 dixi-arch systemd-cryptsetup[602]: Failed to activate with key file '/dev/urandom': Device or resource busy
During the boot sequence the PC stops working and I have to press enter to keep going. Finally i have these errors and a non-encrypted Swap-Device.
blkid:
/dev/sda1: LABEL="swap" UUID="6013541f-7809-4b5f-9702-e630e25fd144" TYPE="swap" PARTLABEL="Linux swap" PARTUUID="9849ee0b-e0d7-4d28-866c-fb7d0134a182"
/dev/sda2: LABEL="system" UUID="4bf8a95c-bf43-4980-92dd-b0eb6dc07093" TYPE="ext4" PARTLABEL="Linux filesystem" PARTUUID="6fc2bd3d-7241-4a88-8137-9985a333e3de"
/dev/sda3: UUID="445eba44-3536-4b99-a0a6-e3629cf90654" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="6b84a546-9873-496c-a7e1-721824023d07"
/dev/sda4: UUID="466b5d04-7b81-4914-b5af-7e2426b801bf" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="dfdf5217-7028-4a10-ae18-3a63450c3231"
/dev/sda128: UUID="9D36-7245" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="9df97a9a-3f5e-487b-a3d1-60825031b537"
/dev/mapper/_dev_sda3: LABEL="dixi-home" UUID="23548045-1c6f-4640-8c62-0f3c48c05f38" TYPE="ext4"
/dev/mapper/_dev_sda4: LABEL="backup" UUID="cbed9ef3-db0b-4750-bf6c-8c42a67ad080" TYPE="ext4"
and theres is no /dev/mapper/cryptswab, what I had expexted
swapon:
NAME TYPE SIZE USED PRIO
/dev/sda1 partition 2G 0B -1
fdisk -l:
Gerät Start Ende Größe Typ
/dev/sda1 2048 4196351 2G Linux swap
/dev/sda2 4196352 109053951 50G Linux filesystem
/dev/sda3 109053952 381683711 130G Linux filesystem
/dev/sda4 381683712 486299982 49,9G Linux filesystem
/dev/sda128 486301696 488397134 1023,2M EFI System
There are some Bug-Reports for fedora, I don't understand, but maybe the problem is, that cryptsetup can't read /dev/urandom.
But this works with my old mbr-partition; therefore I hope for a configuration error
Thanks
Last edited by midixinga (2014-02-09 23:46:06)falconindy wrote:
Looks to me like /dev/sda1 is already a swap device. Since the underlying disk is GPT formatted, systemd finds this and activates it. Your logs and swapon show exactly this.
Feb 09 01:25:41 dixi-arch systemd[1]: Activating swap /dev/sda1...
So, of course, systemd-cryptsetup is going to fail when it tries to encrypt a device which is already in use. Get rid of the swap signature on /dev/sda1.
Wow, thank you very much !
I formatted the partition /dev/sda1 with gparted as "deleted", it's now code 0700 in gdisk
fdisk -l
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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: gpt
Disk identifier: 27980DF8-22E1-4F25-9388-711D1EDE11A9
Device Start End Size Type
/dev/sda1 2048 4196351 2G Microsoft basic data
/dev/sda2 4196352 109053951 50G Linux filesystem
/dev/sda3 109053952 381683711 130G Linux filesystem
/dev/sda4 381683712 486299982 49.9G Linux filesystem
/dev/sda128 486301696 488397134 1023.2M EFI System
Disk /dev/mapper/cryptswap: 2 GiB, 2147483648 bytes, 4194304 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
swapon -s
Filename Type Size Used Priority
/dev/dm-0 partition 2097148 0 -1
journalctl:
Feb 09 16:54:09 dixi-arch systemd[1]: Starting Cryptography Setup for cryptswap...
Feb 09 16:54:09 dixi-arch systemd-cryptsetup[271]: Key file /dev/urandom is world-readable. This is not a good idea!
Feb 09 16:54:09 dixi-arch systemd-cryptsetup[271]: Set cipher aes, mode cbc-essiv:sha256, key size 256 bits for device /dev/sda1.
Feb 09 16:54:10 dixi-arch systemd[1]: Started Cryptography Setup for cryptswap.
Feb 09 16:54:10 dixi-arch systemd[1]: Starting Encrypted Volumes.
Feb 09 16:54:10 dixi-arch systemd[1]: Reached target Encrypted Volumes.
Feb 09 16:54:10 dixi-arch systemd[1]: Found device /dev/mapper/cryptswap.
Feb 09 16:54:10 dixi-arch systemd[1]: Activating swap /dev/mapper/cryptswap...
Feb 09 16:54:10 dixi-arch systemd[1]: Activated swap /dev/mapper/cryptswap.
Feb 09 16:54:10 dixi-arch systemd[1]: Starting Swap.
Feb 09 16:54:10 dixi-arch systemd[1]: Reached target Swap.
I think everything is fine now
Thanks again -
[SOLVED] Cannot "mount swap"
Hi
I cannot mount my swap partition! It stopped working some time ago (I don't know when exactly, I just saw this now).
When I try to mount it manually, I receive this error message: "Unknown filesystem type 'swap'".
Here is my fstab (I'm synchronized with the stable repo):
# <file system> <dir> <type> <options> <dump> <pass>
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0
/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
UUID=1137358e-63f7-4d63-a98a-34d03ac5be0b /boot ext2 defaults,noatime 0 1
UUID=1ce2a0be-3cb7-45f1-aef9-83214ceb3d6a swap swap defaults
UUID=8e33d82d-b7bb-4ea4-aa58-99806a705328 /home reiserfs defaults,noatime 0 1
UUID=954fcd95-c5cc-452d-bd1c-efb8b76aeb22 / reiserfs defaults,noatime 0 1
Thanks in advance.
Last edited by Kknd (2008-08-04 15:19:00)Wow even I accidentally disabled swap somehow and I tried everything, but it would not work ( http://bbs.archlinux.org/viewtopic.php?id=52252 ) . But, changing the line in fstab worked like a charm. Thanks!
(Maybe this is some sort of a bug? ) -
How to mount and use swap partition _only_ for hibernation ?
By "hibernation" I mean suspend to disk.
My disk is a bit poor in RAM and the dirsk is slow, so I want to prevent any swap use of my system.
AND I want to use hibernation, in order to boot fatser... and not to loose my workspace state.
With a swap partition, hibernation works nicely.
But any intensive web browser easily lealds to incresed memory usage, hence swap use.
I have lowered the swap priority in /etc/fstab, down to 1 (and even tried 0).
Still, I am not satisfied : If would like not to use swap at all but for hibernation.
My plan was hence :
1) disable the automatic swap mount at boot
2) add a systemd unit to only moutn before hibernation
The first part was easy : I added a "noauto" option in /etc/fstab. Great, no more mounted swap. But, as expected, no more successful hibernation.
Then I tried to create a custom systemd unit.
- first copy the unit file automatically generated by systemd in /run/systemd/generator/dev-....swap to /etc/systemd/system/
- and add "Before=sleep.target" line in the Unit section
Result file here :
> cat /etc/systemd/system/dev-disk-by\x2duuid-blablablabla.swap
[Unit]
Description=Swap required for hibernation
Before=sleep.target
[Swap]
What=/dev/disk/by-uuid/blablablablabla
Priority=5
>
Next step show be to enable it, but I first run a safety check :
> systemctl show dev-disk-by\x2duuid-blablablabla.swap
Id=dev-disk-by\x2duuid-blablablabla.swap
Names=dev-disk-by\x2duuid-blablablabla.swap
Requires=-.mount
Wants=system.slice
BindsTo=dev-disk-by\x2duuid-blablablabla.device
RequiredBy=swap.target
WantedBy=dev-disk-by\x2duuid-blablablabla.device
Conflicts=umount.target
Before=sleep.target umount.target swap.target
After=systemd-journald.socket dev-disk-by\x2duuid-blablablabla.device system.slice -.mount
RequiresMountsFor=/dev/disk/by-uuid/blablablabla
Description=Swap required for hibernation
LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/etc/systemd/system/dev-disk-by\x2duuid-blablablabla.swap
UnitFileState=static
InactiveExitTimestampMonotonic=0
ActiveEnterTimestampMonotonic=0
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=yes
CanStop=yes
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
>
The problem here is that, somehow, a RequiredBy=swap.target line is apaprently automatically added, and makes exactly NOT what I want.
I've been battling a bit with systemd, but so far I have no clue how to do this correctly.
Important : I wand a clean "official" way, not to do a "service" unit that calls an home-brewed script taht calls swapon. I can do that, but systemd should be able to do it better than me, and without any trick.Hello and thank you all
@fdservices & @WonderWoofy :
In fact, I forgot to mentionned swappiness, just tought about mentionneing the swap priority which act at a very different level is only revelevant when you ahve several swap files.
I have already modified that setting since quite a long time... and it indeed makes the system behaviour so much better.
Honestly, I could do with it... that's what I am doing since a few months in fact, and it really largely improved the user experience.
Still, the setting only makes swapping unlikely, but does not forbid it.
@WonderWoofy & @lucke :
You may be right, I could satisfy with swapiness...
Still, my feeling is that swap at run-time is mostly a remeniscence of the time where having several megabytes of RAM was juste a fantasm. At that time, at least for some intensive operations, simulating more RAM thansk to the cheaper & slower disk capacity was really decisive for a good user experience... and to allow some operations like some huge compilations. My feeling is that today, with our Gigabytes of RAM on our desktop/laptop, the need is much lower. In fact a swap is probably counter-productive for SSD for example (fast, yes, but swap is by nature something you write quite often, reducing teh SSD lifetime significantly). And simulating extra RAM is also counter-productive with applications such as web browsers which handle large amount of memory to handle cache themselves; it causes memory pressure, hence trigger swapping and machien slowdown instead of trigerring their pseudo-smart memory cleaning mechanisms. Last but not least, it does not encourage any improvement on application memory needs and rationalisation.
In fact, unless when I compile huge programs, or on really-limited-memory (embedded) systems, or eventually if swap can be hosted on significantly faster-than-storage disks, I feel that swapping does not really improve the user experience and system performance... and in contrary reduces them by having to handle swapping on and off memory & cache pages.
SO that's why I want to try. It's OK if I fail, swappinees fixes most my user experience issue, but I try to solve my more "theorical" issue as well.
And honestly, it is also to lean & play a bit with systemd as well.
More to come, I have things partially working now. Partially for now, and maybe perfectly with your help ? -
I had a doubt that is a partition with the name 'swap' needs to exist on a 10g DB server for swap space to be used. My current 10g DB server does not have a partition with the name 'swap' explicitly. It has the following kind of structure.
[root@JispNewDB scripts]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p8 48G 12G 34G 26% /
/dev/cciss/c0d0p3 48G 22G 24G 49% /backup
/dev/cciss/c0d0p1 99M 12M 83M 12% /boot
/dev/cciss/c0d0p2 191G 33G 149G 18% /crestel
none 4.0G 0 4.0G 0% /dev/shm
/dev/cciss/c0d0p9 24G 81M 23G 1% /home
/dev/cciss/c0d0p5 48G 6.6G 39G 15% /indexes
/dev/cciss/c0d0p7 48G 85M 46G 1% /tmp
/dev/cciss/c0d0p6 48G 32G 14G 70% /u01
Does, it mean that swap space will not be used in the system? There is 16 GB of swap space otherwise on the system.
I hope, my question is clear.
Please, help in solving the doubt.
regardsIs command free showing swap?
If You have linux, then You can execute
swapon -s - this will show all swap files or partition defined on system
look into /etc/fstabs as well to see is there defined swap partition.
fdisk -ls will show as well.
If above are showing swap - then You are using swap. -
Creating Swap Partitions for Oracle 8
I am in the delimma of having already installed RedHat 5.2, with
the intention of installing Oracle 8, however, I have created a
swap partition of 32MB on a machine that has 48MB of RAM.
Rather than repartition my hard drive to create a swap partition
that is three times the size of the RAM installed, (as
recommended by the installation guide), would I be able to
create a swap file to overcome this limitation?
nullBill Tourloupis (guest) wrote:
: I am in the delimma of having already installed RedHat 5.2,
with
: the intention of installing Oracle 8, however, I have created a
: swap partition of 32MB on a machine that has 48MB of RAM.
: Rather than repartition my hard drive to create a swap
partition
: that is three times the size of the RAM installed, (as
: recommended by the installation guide), would I be able to
: create a swap file to overcome this limitation?
You can create swap on a file using the following script. Replace
"u01" with your mount point. Change "count" to the number of 1K
blocks you want.
dd if=/dev/zero of=/u01/swapfile bs=1024 count=524288
mkswap -c -v1 /u01/swapfile
chmod 0600 /u01/swapfile
swapon /u01/swapfile
swapon -s
null -
Is a swap partition necessary?
I was wondering if the Arch install procedure allows for
installing without creating a swap partition. In my current hard
disk setup it would be simpler if I did not have to change
the partitioning.
Creating a swap file instead on an existing partition works
just the same, as far as I can tell.
P.S. Does the base CD come with a PPPOE dialer?
Thanks to all for any help.segmental wrote:I was wondering if the Arch install procedure allows for
installing without creating a swap partition.
of course.
If you already have prepared partitions (or aren't afraid doing this by hand) I would recommend you quickinstall script that comes with iso image.
Check wiki.archlinux.org for detailed instruction on how to use it.
cheers
Maybe you are looking for
-
Getting the same text more than once
I keep getting the same numerous texts more than once from my friends and one of my friends even said that they were getting my texts out of order. Is it my phone or the network?
-
Does anybody else get this. Burn a play list to cd, when the finished CD mounts itself at the end the finder shows one CD with the burn list name and still shows the blank cd which is not there as i have one drive. To get rid of them i have to eject
-
Image Capture doesn't recognize iPhone and Camera anymore
Image Capture doesn't recognize my iPhone or my Fujifilm camera. I am pretty sure this happened after updating to Safari 4.0.2 and having to restart which I did today. Yesterday I was able to to browse through my devices.
-
can you send me a fresh copy of Mac os Snow leopard 10.6???
-
What can i do for syncserver.exe and mobiledevice.exe error?
hello i have a problem with iTunes..... When i plug the phone to computer, itunes get a error: synserver.exe,mobiledevicehelper.exe and mobilebackup.exe stopped the working..... please help