Bog'liq Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)
[ 12 ] Admittedly, we're getting ahead of ourselves here. After all, we're only just getting
started and the point of this chapter is to help you set up a basic Ubuntu Server
installation to serve as the foundation for the rest of the chapter. When going
through the installation process, we'll accept the defaults anyway. However, the
goal of this section is to give you examples of the options you have for consideration
later. At some point, you may want to get creative and play around with the
partition layout.
With custom partitioning, you're able to do some very clever things. For example,
with the right configuration, you'll be able to wipe and reload your distribution
while preserving user data, logs, and more. This works because Ubuntu Server
allows you to carve up your storage any way you want during installation. If you
already have a partition with data on it, you can choose to leave it as is so you
can carry it forward into a new install. You simply set the directory path where
it's mounted to be the same as before, restore your configuration files, and your
applications will continue working as if nothing happened.
One very common example of custom partitioning in the real world is separating the
/home
directory into its own partition. Since this is where users typically store their
files, you can set up your server such that a reload of the distribution won't disturb
their files. When they log in
after a server refresh, all their
files will be right where
they left them. You could even place the files shared by your Apache web server
on to their own partition and preserve those too. You can get very creative here.
Another reason to utilize separate partitions may be to simply create boundaries or
restrictions. If you have an application running on your server that is prone to filling
up large amounts of storage, you can point that application to its own partition,
limited by size. An example of where this could be useful is an application's log files.
Log files are the bane of any system administrator's life when it comes to storage.
While helpful if you're trying to figure out why something crashed, logs can fill up
a hard disk very quickly if you're not careful. In my experience, servers have been
known to come to a screeching halt due to log files filling up all the available free
space on a server where everything was on a single partition. The only boundary
the application had was the entirety of the disk itself.
It probably goes without saying, but when reinstalling Ubuntu,
you should back up partitions that have data you don't want to be
wiped (even if you don't plan on formatting the partitions). The
reason being, one wrong move (literally a single checkbox) and
you can easily wipe out all the data on that partition. Always back
up your data when refreshing a server.