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. askubuntu.com/questions/440326/… – user508889 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
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.