LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 06-22-2013, 09:20 AM   #1
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Rep: Reputation: 17
Talking Best partition strategy with 1xSSD and 1x2TB disks for 5-10 VBox appliances


Hi guys,

I have just build-up a fresh desktop and was wondering how to partition it.

The machine specs:
Quote:
Motherboard: Asus P9X79 Deluxe
Processor: Core i7-3930K
Memory: 32 GB (4x8GB Corsair Vengeance)
GPU: Sapphire Radeon Vapor-X HD 7970 GHZ OC 6GB
Disks:
  • 1 x OCZ Technology 256GB Vector Series SATA 6.0 GB/s 2.5"
  • 1 x Seagate Barracuda 2TB 7200 RPM 64MB Cache SATA 6.0Gb/s 3.5"
The 4 most important concerns I have are:
  1. My intention is not to build an enterprise virtualized server, I just want to have some VMs for information security testing, meaning that I want an environment in which I could simulate attacks and pentesting techniques against Windows/Linux boxes, etc.
  2. The motherboard supports UEFI so whatever systems I want to install should be able to support it;
  3. I will install 5-10 Virtual Machines on Linux (Oracle's VirtualBox), and for that I plan to use the /usr partition
  4. I'd be using Windows solely for gaming purposes, that's why I left more space for it, as we know Linux doesn't need that much to be superb.

That's the initial scheme I came up with:

SSD (256 GB)
  • OS1: Win7 - ntfs (200 GB)
  • OS2: Ubuntu Server 12.04 LTS (or another TBD) - ext4 (56 GB)
Partitions:
/ (filesystem root)

*/etc/fstab mounting options - maximizing SSD performance:
Code:
/dev/sda   /   ext4   noatime,nodiratime,discard,errors=remount-ro 0 1
Mechanical HDD (2.0 TB)
  • ntfs (1.0 TB) - Windows repository (Movies/Music/etc)
  • ext4 (1.0 TB) - Linux variable partitions and VM's
Partitions:
  • /home (500 GB)
  • /usr (400 GB)
  • /var (50 GB)
  • /tmp (20 GB)
  • /swap (30 GB)
I don't really know if that's the optimal strategy for partitioning the system in terms of disk space allocation for each of the partitions, so I'd love to get some insights from the expert community.

Most importantly, I'm not sure if the fact of installing the VMs on a separate disk (/usr partition) will slow down the overall access to the VMs, for instance, when I open-up 8 VMs simultaneously.

Thank you in advance for your tips!

Last edited by sl33p; 06-22-2013 at 09:23 AM.
 
Old 06-22-2013, 03:44 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Opps, thought you'd need a /boot but I see maybe no. Some of that efi stuff has you creating goofy partitions if you also use secure boot.


We do get some discussion on the benefits if any to partitions once in a while. In your case, I can't really see any logical reason to do this.

/home (500 GB)
/usr (400 GB)
/var (50 GB)
/tmp (20 GB)
/swap (30 GB)


Home on a partition may be more useful for crash and reload.

I'd think way too much swap. Each vm can have a virtual hard drive that you load swap on to each vm. The amount you have isn't easily available to vm's unless you need to hibernate it all.

Locking into partitions on test systems just caused issues later on changes.

Just my humble opinion and I'd sure others have opposing and equally logical ideas and reasons.


Maybe if you had lots of drives and nfs and iscsi then you could consume many mount points.

Last edited by jefro; 06-22-2013 at 03:51 PM.
 
Old 06-22-2013, 04:32 PM   #3
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
Thanks for the insight about the /swap partition. I will follow your advice.

Regarding the /home partition, my intention is to store documents (Pdf's, videos, etc), that will probably be accessed/replaced on a frequent basis. So, as the SSD's have limited number of I/O writes, I decided to create /home as a separate partition on the mechanical disk.

Regards!
 
Old 06-22-2013, 09:04 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
That reason makes sense then if you want or expect to move stuff around.

Maybe others have some ideas on this to share.

Last edited by jefro; 07-01-2013 at 03:00 PM.
 
Old 07-01-2013, 11:12 AM   #5
bimboleum
Member
 
Registered: Oct 2009
Posts: 111

Rep: Reputation: 23
Hi,
I have a somewhat similar setup, except that I have a (much) smaller SSD and I have 2 spinning disks.

I put the OS (Slackware) on the SSD. On the smaller harddrive (500G) I put a swap partition (64G since I have 32G of RAM and I use the 2* algorithm!) and make the remainder a single partition which forms a volume group (vg0).

Within this volume group I have created logical volumes for /tmp, /var, /etc, /home, /opt and /VMs. This makes the SSD drive virtually read-only. By using LV's I can start with minimal size and expand as needed.

I have the second harddrive set up as a single volume group (vg1). I use the /VMs directory (mounted LV) to hold the virtual machine definitions. This directory looks like:-

/VMs ---> images
vm1
vm2
...

images holds any iso images or other stuff that the virtual machines might need (this is a convenience to me).
Each virtual machine definition is in it's own directory (vm1 etc). Each virtual machine has one or more logical volumes in vg1.

Virtualbox will allow you to use a disk partition (logical volume) directly as a virtual harddrive. This involves using the command-line tools (see virtualbox docs).

Or you can mount the LV and create virtual harddrives as files under this mount point. Using the second route, you can define the LV just big enough to hold your initial harddrives, and then expand it if (when) you want to add more virtual harddrives.

This is the theory!!! ....

The practice ....

Tell virtualbox that you want your machine defs to be in /VMs (or wherever)

Create virtual machine vm1 (using the virtualbox wizard) but do NOT create a virtual harddrive.
This will create the directory vm1 under /VMs which will contain the virtual machine definition.

Using route 2 above, define your LV, format it with your favourite file system, mount it on (say) /mnt and copy all the files in /VMs/vm1 onto it.

Unmount /mnt.

Erase all the files in /VMs/vm1, and mount your LV onto /VMs/vm1.
Now go back into virtualbox and edit the settings to add your virtual harddrives.

Thus you get all your virtual machine definition onto the one LV. NOTE if you define vm1 (and mount the LV onto it) BEFORE the initial creation of vm1, the wizard will barff because it needs to create the vm1
directory itself ... silly wizard but what can you do!

Repeat as needed.

This is how I do it. Others may (will almost certainly) have better ways and ....
.... as always, remember YMMV :-)

cheers
pete

pete hilton
saruman@ruvolo-hilton.org
 
Old 07-12-2013, 03:51 AM   #6
Milo4t
Member
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 45

Rep: Reputation: 11
best-partition-strategy-with-1xssd-and-1x2tb-disks-for-5-10-vbox-appliances

Hey there good people.
I too would like some help on this. I have a simialr setup to sl33p, 1 x 240Gb SSD, 2 x 2Tb HDD, 8Gb RAM.

Okay, this is on a brand new system with Windows 7 64Bit installed on the SSD. The system works with UEFI not BIOS. The 2Tb disks are MBR.

I want to have a huge /home as I have lots of photos, media files etc. which I currently store on a 3Tb external HDD (~1.4Tb worth) . I want to bring them onto the internal HDD and go through all my collections and clean them up. Only using the external HDD for backups. So I would allocate my /home on 1 of the 2Tb drives. I will allocate the other to some storage for Windows and holding other Linux installations (with relevant partitions on the SSD)

I read that you shouldn't have too much write activity to an SSD or it wears out faster. But I suppose I could just replace that in a few years time. I have also read somewhere that the SSD (even with lots of writes) should last about 5 years.

In an article I read
Quote:
"How to maximise SSD performance with Linux" http://apcmag.com/how-to-maximise-ss...with-linux.htm
he says NOT to allocate swap on the SSD, but to put it on a HDD. So what if I do this:

SSD Windows 100Gb
Linux / 20.6Gb

HDD 1 /swap 3.8Gb (I presumed that I had to make it as large as my RAM, but reading a few threads/articles - quickly - it seems that I can get away with a lot less).
Windows data 50Gb

The rest I will divide into various Linux installs (1 being a Linux testing environment for my main Linux install).

So thoughts on this?
 
Old 07-12-2013, 05:58 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
do not forget tmpfs for /run and /tmp (or /var/run, /var/lock and related)
 
Old 07-14-2013, 02:34 AM   #8
Milo4t
Member
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 45

Rep: Reputation: 11
I don't understand your answer

pan64. sorry I'm pretty much a Linux newbie - even though I have dabbled with it since the early 90's - I only switched full-time in 2009 but still don't understand a lot about it, just use it. In my current setup I just installed the system in a single partition. Now with my new system and an SSD (and writes to it wearing it out) it's whole different ballgame! So I don't know anything about tmpfs (although I was just reading some threads about it and it's uses - still not really any wiser!)
So if I install / onto SSD, /swap, /home etc. onto the HDD will that be okay - even though the journals are in / (lots of writes???)?
 
Old 07-31-2013, 07:27 PM   #9
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
Talking

Thank you all for the tips.

Specially Pete, that was the answer I was looking for. I will use LVM due to its flexibility, but honestly, I will go through the documentation of VirtualBox to learn how to make it use the LV directly via command line, 'cause I think this might be slightly easier than the proposed "route 2". )

pan64, I won't forget that!
 
Old 07-31-2013, 07:44 PM   #10
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
That will probably help in setting up the "route 1" solution:

http://www.parkingdenied.com/2009/05...irtualbox-lvm/
 
Old 08-01-2013, 07:15 AM   #11
dt64
Member
 
Registered: Sep 2012
Distribution: RHEL5/6, CentOS5/6
Posts: 218

Rep: Reputation: 38
@Milo4T:

I guess there was some good advise in this already and I don't want to stress it too much, but let me add one more thing:

Use LVM for your 2TB HDDs.

You can add both to the same volume group and then adjust LVM partition sizes as you need, e.g. 3,5TB for /home and all the rest for your Windows stuff. Choose initial partition sizes you feel comfortable with and expand them if they fill up. In case you need more that 4TG in the VG just add yet another HDD and you are done.
 
  


Reply

Tags
partition, ssd, strategy, virtualbox



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] vbox 4.0.2 - guest sabayon5.4 on win7 - mnt local gentoo from vbox sabayon? shinystuffrox Linux - Virtualization and Cloud 1 03-04-2011 01:10 AM
Moving Vbox partition from ext4 fs to NTFS silvyus_06 Linux - General 5 12-04-2010 10:21 AM
[SOLVED] Partition Strategy -> SSD Drive jv2112 Linux - Hardware 10 10-20-2010 03:49 AM
Partition and Setup Strategy ashwken Slackware 5 07-17-2006 01:15 AM
Is this the correct partition strategy for a database? cstovall Linux - General 1 03-03-2003 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration