Jani Hur's picture

I have a TKLDev TurnKey appliance tailored for an installation of Oracle XE 11g. Oracle has swap space requirement:

Minimum swap space required for Oracle Database XE is 2 GB or twice the size of RAM, whichever is lesser.

How do I can set the swap partition size for the appliance ? Currently with debian it looks like there is rules how swap size depends on RAM. As I can probably run the appliance with less memory than 2 GB I'd like to set the swap partition size explicitly to the required minimum value.

I have googled and read e.g.

Newb Q: where is the swap partition, and how do i make it bigger

change disk size on project pier virtual applance

but I'm a bit lost at the moment.

Jeremy Davis's picture

And TBH I'm not sure what the default is for TKL.

If you want to have your appliance default to 2GB at install then you'll have to dig into the installer logic... TKL uses a modified version of di-live to install but TBH I wouldn't know where to start to modify that to do what you want...

Nauseous's picture

You can create swap a few ways here are two

If you have enough space on the drive you could use: (preferred to use a second drive for swap; faster!)

cd /

dd if=/dev/zero of=/swapfile bs=1M count=10240  <-- I usually change it to equal about 5G

Now mount it on boot but test manually before a reboot

vim /etc/fstab
/swapfile               swap                    swap    defaults        0 0

mount -a  <-- mounts all

swapon -s  <-- verify mount of swap

You can also "create image" meaning a AMI then launch and add extra drive on AWS and do this

fdisk /dev/xvdb  <-- which ever disk you created

With fdisk create partition type 82 which is swap

mkswap /dev/xvdb

swapon /dev/xvdb

Now have fstab automount it.

cat /etc/fstab
/dev/xvdb               swap                    swap    defaults        0 0

Then type "mount -a"

and finally

swapon -s

Be careful that you test mounts before rebooting a remote machine like AWS's otherwise 'HANG IT HIGH!'

Add new comment