Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
multiple swap partitions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Mike46
n00b
n00b


Joined: 28 Oct 2006
Posts: 39

PostPosted: Mon Jul 27, 2015 6:52 am    Post subject: multiple swap partitions Reply with quote

I have two distributions on this machine. I have noticed that both swap partitions are getting loaded on boot. If I look at the output of the free command I am also seeing double the amount of swap space that I was expecting.

Arch Swap /dev/sda5
Gentoo Swap /dev/sda9

systemctl --type swap

Code:

UNIT          LOAD   ACTIVE SUB    DESCRIPTION
dev-sda5.swap loaded active active Swap Partition
dev-sda9.swap loaded active active /dev/sda9


Does anyone have any idea how to prevent this?
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Mon Jul 27, 2015 8:31 am    Post subject: Reply with quote

What's in your /etc/fstab on both?

Also, you can, if you don't plan on hibernating one partition while booting into the other, perfectly well share a swap partition between both.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2273
Location: Bardowick, Germany

PostPosted: Mon Jul 27, 2015 10:28 am    Post subject: Reply with quote

And you can order their usage with the "pri=<num>" option in fstab.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3684
Location: Hamburg

PostPosted: Mon Jul 27, 2015 11:31 am    Post subject: Reply with quote

/etc/init.d/swap might be too intelligent - especially if would mount swap devices aren't defined in /etc/fstab.
Back to top
View user's profile Send private message
Mike46
n00b
n00b


Joined: 28 Oct 2006
Posts: 39

PostPosted: Mon Jul 27, 2015 6:55 pm    Post subject: Reply with quote

mi_unixbird wrote:
What's in your /etc/fstab on both?

Also, you can, if you don't plan on hibernating one partition while booting into the other, perfectly well share a swap partition between both.


I was wondering about just sharing a single partition since this is my desktop machine. It may just simplify the whole issue. Since it looks like systemd is running amok activating everything it can find intead of just whats in fstab.

Gentoo fstab

Code:

/dev/sda1               /boot/efi       vfat            defaults                0 1
# /dev/sda7             /boot           ext2            defaults,noatime        0 2
/dev/sda8               /               ext4            defaults,noatime        0 1
/dev/sda9               none            swap            sw                      0 0
/dev/sda10              /home           ext4            defaults,noatime        0 2
/dev/sda7               /mnt/data       ext4            defaults,noatime        0 2
/dev/cdrom              /mnt/cdrom      auto            noauto,ro               0 0


Arch fstab

Code:

# UUID=ca67637d-d21c-481c-992c-2caadbd11eb3
/dev/sda4              /            ext4         rw,relatime,data=ordered   0 1

# UUID=f0818249-96b3-48fb-807d-d935db8377f5
/dev/sda6              /home        ext4         rw,relatime,data=ordered   0 2

# UUID=5CDF-9141
/dev/sda1              /boot/efi        vfat         rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro   0 2

# UUID=3d3ff66e-e057-43a9-b6ed-a991c1577a37
/dev/sda5              none         swap         defaults     0 0
Back to top
View user's profile Send private message
Mike46
n00b
n00b


Joined: 28 Oct 2006
Posts: 39

PostPosted: Mon Jul 27, 2015 6:58 pm    Post subject: Reply with quote

toralf wrote:
/etc/init.d/swap might be too intelligent - especially if would mount swap devices aren't defined in /etc/fstab.


Isn't it swap.target that is running the show in the case of systemd?
Back to top
View user's profile Send private message
Mike46
n00b
n00b


Joined: 28 Oct 2006
Posts: 39

PostPosted: Mon Jul 27, 2015 7:06 pm    Post subject: Reply with quote

Yamakuzure wrote:
And you can order their usage with the "pri=<num>" option in fstab.


So what I gathered from the Arch wiki, and the man page is that pri=0 would disable the swap partition for that boot if another swap partition had a higher priority? The single shared swap might be a little less complicated though since its a desktop machine and I don't use hibernate.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Mon Jul 27, 2015 10:55 pm    Post subject: Reply with quote

Having both swaps active should not harm anything. Nothing persistent is saved there anyway.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum