Partitioning scheme for Ubuntu Server

Partitioning scheme for Ubuntu Server

by Ryan B -
Number of replies: 8
Hi all,

I'm migrating our moodle server to a large 2TB hdd and was curious about partitioning it differently. Basically, I have students upload many files - everything from Office (.docx, .pptx) to even audio (.mp3) and video files (.mp4, usually). As such, I want to make sure that the partition where these files are stored has the largest space so I don't run out.

However, even after googling, I'm not sure which partition it is. I'm a self-taught/googling Ubuntu server user, so I know I need the /, /home, /boot directories. How would I go about partitioning this hdd to allow the most space for student file uploads?

Thanks!


Average of ratings: -
In reply to Ryan B

Re: Partitioning scheme for Ubuntu Server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I've read this a few times and I'm really struggling to understand your question. 

If it's a single disk the Ubuntu install will, by default, create a single big partition (well, it may create a swap partition but don't worry about that). To be honest, on a single physical disk I would just go with that. Put your 'moodledata' directory anywhere you like - I usually create a directory '/var/moodledata' but that's nothing to do with partitioning. 

I think, maybe, you might be confusing partitions with directories in some way but I'm not sure. 

It would be possible to create, say, a separate (roughly) 1.5TB for your data and the rest for everything else. Where it lives is called a 'mount point' and is completely arbitrary (you could specify '/data' for example) but (on a single) disk I just wouldn't bother.

In reply to Ryan B

Re: Partitioning scheme for Ubuntu Server

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You said:
> I want to make sure that the partition where these files are stored has the largest space so I don't run out.

Then use the whole disk! In other words don't partition. Sure, you need one partition, the root partition, denoted '/'. No other partitions which will one day become an artificial limit when it gets filled. i.e. basically what Howard said.
Average of ratings: Useful (2)
In reply to Ryan B

Re: Partitioning scheme for Ubuntu Server

by Jeff White -
Check your "$CFG->dataroot" in moodle/config.php to find where all files are going in your Moodle install. 


I am guessing your server is a single physical machine so I would just add the drives to your machine and mount your volume to something like /moodle/moodledata or /data/moodle/moodledata. That way as your environment keeps growing you only have one location to worry about. I keep my moodle folder, moodledata, and the MySQL datadir in the /data mount on my single server test machines. It makes life a great deal easier to manage things. 

For a production environment, I would highly recommend you do some serious research and planning on your storage management. If you have a team that managers your organization's storage, get in contact with them. If you are on your own, then at least consider making your /moodle or /data folder volumes RAID 1 so in the event of disk failure, you do not loose your entire website. 

Average of ratings: Useful (2)
In reply to Ryan B

Re: Partitioning scheme for Ubuntu Server

by Paul Verrall -

Hi Ryan,

I'm going to ignore that you have lots of space and give you my 'best practice' answer... It might end up best serving  other people with the same question who end up here if not you specifically. (and also ignoring the semantics of folder, directory, mountpoint, block device, partition, disk etc... if you don't know the difference go find out.)

Personally I would never recommend using one big partition as others have suggested. IMHO you should have at least /var/log and whatever the path of your moodledata is in split into a separate partitions or devices. These are the areas of the filesystem that can/may grow continually and so should be separated from the OS partitions so that if they do grow unexpectedly big they do not interfere with the OS itself. You might want to also consider /tmp /home and /var generally... 

What I believe you should be doing is partitioning using LVM. This way you can grow your partitions as you require... Unexpectedly need more space for logs? fine grow the partition live online!... need more moodledata space... again grow online! Find yourself with no space left on the disk as all? No problem add a new physical disk and use it to grow your existing partitions into it

In a modern operating system there is zero need to pre-allocate partition sizes. You are doing it wrong if you are (IMHO).

Now, go see this: https://wiki.ubuntu.com/Lvm

Average of ratings: Useful (3)
In reply to Paul Verrall

Re: Partitioning scheme for Ubuntu Server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In my defence...

What you suggest is undoubtedly best practice and probably what I would do myself. I'm not sure this is the best answer for the OP, however.  But, yes, if he wants to do some more reading and understand this properly (no bad thing) using LVM would be a much better idea.