1

I have a 256GB solid state drive on which I plan on installing Xen and a few VMs. For the host (dom0), I want to use Ubuntu Server 16.04 and have it take up as little space as reasonably possible. During setup, I select "Guided - Use entire disk and setup LVM" and set the size of the partition to be 20.0 GB. When installation was finished, df showed 2.5GB allocated with 1.3GB free. swapoff showed a 16GB swapfile. This is my dom0, so it's not going to be doing much. And it's going to be limited to about 512M to 1G RAM so that much swap is not needed.

Here is the output of df -h after I ran it again with 50.0 GB. You can see there's only 30G on /

@garden:~$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         7.8G     0  7.8G   0% /dev
tmpfs                        1.6G  8.9M  1.6G   1% /run
/dev/mapper/garden--vg-root   30G  1.7G   27G   6% /
tmpfs                        7.9G     0  7.9G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda1                    472M  101M  347M  23% /boot
tmpfs                        1.6G     0  1.6G   0% /run/user/1000

And here's the output of swapon -s

Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       16732156        0       -1

At the end of the day, space is cheap so I can get by with a bloated, unused swapfile. But my question is, is there a way to install Ubuntu Server without a swap file? Or with a smaller swap file?

  • I'm really confused. You say that you made your root partition to be 20GB, but it shows as 27GB according to df -h. – earthmeLon May 30 '16 at 19:17
  • Helpful information. http://askubuntu.com/questions/440326/how-can-i-turn-off-swap-permanently –  May 30 '16 at 19:18
  • I reran the whole thing with a 50GB partition so I could move on. That's in the note above the output: "Here is the output of df -h after I ran it again with 50.0 GB. You can see there's only 30G on /" – TinyTheBrontosaurus May 30 '16 at 19:19
  • Thanks bc. I saw all that info and I understand the risks of turning it off. And really, I don't want it off, I just don't want it huge. The machine is only going to see 512MB of memory anyways after I install the hypervisor. – TinyTheBrontosaurus May 30 '16 at 19:20
  • Yeah, the accepted solution is best though, so if you do nothing else, turn the swapiness to a low value. –  May 30 '16 at 19:26
  • 1
    That disables swap, sure. That's not my goal. My goal is not to allocate the 16GB to begin with; or at least allocate less. – TinyTheBrontosaurus May 30 '16 at 19:28
  • Ahh, I just reread it, makes sense. –  May 30 '16 at 19:38

0 Answers0