0

I've got a 3Tb External Hard Drive that I would like to use to run my Raspberry Pi2.

I'd like to have a few separate partitions for various services:

  • Transmission
  • Owncloud
  • Ftp (to save images from my IP cameras)

Naturally, I'd also want a / partition for booting. The big question is: how big does that partition need to be?

Naturally, dedicating a whole Terabyte to it would be overkill, And I know that I can have it on 16Gb (or even 4), but is all that space necessary?

What is a good size that would not be too small and at the same time, not wasting space?

Also, is a swap partition needed?

5
  • If it will be Lite version without any GUIs 4GB will be enough, but maybe in future you will need GUI so make it 8GB.
    – Huczu
    Commented May 30, 2016 at 9:05
  • Hey @Huczu, thanks for the feedback. Is 4Gb really Needed? Or would 2Gb suffice? or maybe 3? (It will be the lite, headless install, as it's going to be a server, I can always access it via SSH from elsewhere when needed, and will never need a GUI installed). I see that the jessie-lite image is around the 1.4Gb mark, and just don't see how I can fill up the other ~600Mb. Usually, I use up maybe 300mMb or so with updates and other programs. but now that I'm intending on using another partition to store all my user files, surely, <4Gb would be more efficient?
    – Jim
    Commented May 30, 2016 at 9:17
  • Less disc space for root partition will not affect the efficiency. The recommended sdcard size is at least 4GB. You've got 3Tb size HDD what's the difference for you that it will be 4GB or 8GB?
    – Huczu
    Commented May 30, 2016 at 9:41
  • No real difference (0.13%) except HDD usage efficiency. No point in wasting space. Any ideas about swap partitions?
    – Jim
    Commented May 30, 2016 at 9:47
  • You can make it on external HDD it can speed up some operations. It can be <1Gb. Also if you don't want to waste your space put / with /boot (which is necessary; boot must be from sdcard) on 4GB sdcard.
    – Huczu
    Commented May 30, 2016 at 9:56

1 Answer 1

1

There isn't really a best partition size here, at least not in a way that is relevant to the operating system or the pi and hence that would be on-topic and specific to the pi.

Going off-topic a bit in that sense, I would say the most significant consideration is sparseness. Leave as much room as you can without compromising your other needs. The more room the OS has to play with, the more easily it will be to keep things organized in the most efficient manner. For example, a system with a root filesystem only 25% used will probably perform slightly better over the long term than one used 60%, and they will both perform much better than one used to 90 or 95% capacity (i.e., there is a curve in play performance wise and as you approach 100%, things will become more and more dysfunctional; try to avoid going over 75%).

Another advantage to this is it may spare some wear and tear on spinning disks where partitions really are constrained to specific portions of the disk and it is better to slowly wear out the disk as a whole rather than quickly wear out a small section of it. This logic does not apply to solid state devices, which use virtual addressing to distribute partitions dynamically.

As to how much space might be used by the root fs if you are using it primarily for system/distro software, this depends a lot on how much stuff you want to install. 50-100 GB is not that hard to reach, so setting aside 200-250 GB should be good. You could split that in half and use two partitions if you know how to keep yourself organized but if you have a whole TB to play with it is likely not worth the bother of ending up with 5-10 partitions on one drive for different specific purposes. Use bigger partitions and exploit the directory structure instead, it is more flexible.

Minimally, I would not go smaller than 8-16 GB, although it is certainly possible to run a pi with a root fs < 2 GB (or < 1 GB, or if we really want to put in some time pairing things down, < 1/2 GB, but why bother here?).

Linux and ext4, the default and recommended filesystem type for the root filesystem, are commonly used on terabyte size partitions so that is not an issue. You may or may not want to consider dividing the disk up and using some form of RAID partitioning to add automated data protection by storing it redundantly -- note would mean cutting the available space by 1/2, 3/4, etc. Personally I think it is a waste of time in this case (and may come with its own risks); if you want to redundantly protect your data using the same drive, maintain a back-up partition.

Any ideas about swap partitions?

On a Raspberry Pi, do not bother with anything beyond 2 GB. If you end up using more than that, do yourself a favour and buy something that isn't a pi and has more than 1 GB RAM.

6
  • Very detailed, thanks. I think that maybe 50 - 250 Gb may be a bit overkill. To be honest, I hadn't even considered the HDD wear over a smaller head-travel area. Would it be better to use a dedicated USB memory stick for the OS (on one USB port) and then various partitions for other tasks on the HDD? As for a swap partition; maybe I'll leave that as a swap file and on the memory stick as well. (I seem to recall the Pi2 sharing the 480mb/s among all 4 ports though). I don't intend on taxing the Pi to the point of using swap, but things don't always go to plan.
    – Jim
    Commented May 30, 2016 at 13:35
  • I don't see the point in putting it on a separate stick when you have the drive attached, you are just adding unnecessary amperage. WRT head travel, I had not taken that into account, but I believe modern disks in combination with modern OS's and filesystems will optimize this such that it is not worthwhile going for a small travel by making a small partition.
    – goldilocks
    Commented May 30, 2016 at 13:50
  • The 3Tb USB drive that I'm using is powered by it's own wall wart. Would a 16Gb USB memory stick really add that much to the current draw from the Pi?
    – Jim
    Commented May 30, 2016 at 13:54
  • I guess you could investigate that. I just do not see any possible advantage at all unless your intention is to not have to have the big drive attached all the time. But of course it is your scenario, not mine. Personally I have not bothered with a root fs beyond the SD card; although I do use an external drive for other things and it is clearly (30-50%) faster for file transfer, I usually run headless with ample "free" RAM for the file cache, meaning the system will be mostly running from RAM. Which is the ideal configuration.
    – goldilocks
    Commented May 30, 2016 at 14:01
  • Wow, that much faster? Good to know, I was expecting it to be slower. I've read that using a mySQL db (well, any database really) on an SD card can kill it really quickly because of all the write/rewrites happening. And I think that's why I lost my previous SD card. And because (I thought) it was slower, I thought that using a USB memory card would be the faster option (like using a SSHD) for the fs.
    – Jim
    Commented May 31, 2016 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.