SOLVED How to disable swap on one device

Status
Not open for further replies.

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Hiao all,

so, here is a thing ... i'd like to use USB stick as an storage for my custom scripts, but the swap is taking 3GB of the space from the total 8GB. I'm not saying that 5GB is not enough for few plaintext files ^^ but i just don't see a reason to have swap on USB device o_O

I guess that this is not possible from GUI (i know that there is a way to completely disable swap on all devices but this is not what i want), so only way is to create the FS manually from OS level, but what about the rest things like DB files? These things are manually handled by GUI. Maybe just create the FS manually and then auto-import from GUI could do the trick ?

Using FreeNAS-9.1.1-RELEASE-x64 (a752d35)

Thank you in advance :]


Bottom line:
I have one big "archive" zpool which is "sleeping" most of the time, so i don't want use this one.
Then i have second zpool (two mirrored disks) for plugins, but this once is encrypted for testing purposes, so i can't use this one because the pool is not available on boot.
So, i plugged 8GB USB flash and created UFS FS on it and i'd like to store my scripts there.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Yes, manually creating the partitions and FS from CLI like discussed here (for ZFS) and then auto-importing works. I don't see a reason why this wouldn't work for UFS - I think you have to use the normal import dialog and not the auto-import in this case.
 

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Thanks for confirmation. Looks like its OK now ^^

Code:
 /mnt/misc# gpart show da6
=>      34  15124925  da6  GPT  (7.2G)
        34  15124925    1  freebsd-ufs  (7.2G)


Code:
/mnt/misc# gpart list da6
Geom name: da6
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 15124958
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: da6p1
  Mediasize: 7743961600 (7.2G)
  Sectorsize: 512
  Stripesize: 0
  Stripeoffset: 17408
  Mode: r1w1e2
  rawuuid: 95e34086-6b2c-11e3-814a-00259086c71a
  rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
  label: (null)
  length: 7743961600
  offset: 17408
  type: freebsd-ufs
  index: 1
  end: 15124958
  start: 34
Consumers:
1. Name: da6
  Mediasize: 7743995904 (7.2G)
  Sectorsize: 512
  Mode: r1w1e3


Code:
/mnt/misc# df -h .
Filesystem      Size    Used  Avail Capacity  Mounted on
/dev/ufs/misc      7G    8.0k    6.4G    0%    /mnt/misc


Duno why 6.4GB instead of 7.2 (or something) but i don't care, swap is not there, so thank you ^^
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
The swap setting in GUI only applies to new drives (it will not start deleting/changing swap partitions on existing drives when you change it :)). So, you could set it to 0, create your filesystem in GUI and change it back to 2GB. That's exactly what I did when I added an USB stick for scripts.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Yep, came in here to say what Dusan said. If you have a device that you want to create and you don't want it using swap, you can just temporarily set that GUI option to 0 or whatever desired swap size you want and then create the volume, then set the option in the GUI back to wherever you want it to be for any newly created drives after that particular one you wanted with a different swap size.
 

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Okie guys, noted. I probably missed this when searching in docs. Thanks.
 
Status
Not open for further replies.
Top