LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2011, 03:47 PM   #1
Stefaans
LQ Newbie
 
Registered: May 2011
Location: Belo Horizonte, MG, Brasil
Distribution: Ubuntu
Posts: 6

Rep: Reputation: 0
Partitioning advice for a 500GB HD - Ubuntu 11.04 64-bit


Hello

Background
I have recently bought a second, clean 500GB hard drive for my laptop PC, and intend to install Ubuntu 11.04 64-bit on it with the intention of eventually replacing my existing hard drive (running Windows 7) and using only Linux. Before I start with the installation, however, I want to get the partitioning right to avoid problems further down the line. I’ve done a bit of reading on the net to try and teach myself as much as possible about this, but there is an overwhelming amount of material covering this subject, much of it apparently out-dated and contradictory (to me at least).

As a Linux newbie I understood little of what was being said, but it did lead me to believe that I need to partition the clean hard drive more or less as follows:

1. Root partition on which I will install Ubuntu, 20GB. I’d like to have only the OS on this partition, and enough space so that I can easily experiment with different distros down the line.
2. Swap partition, 9GB (I understand the rule of thumb is the swap partition must be at least equal to the amount of RAM)
3. A partition for personal data and the system files of all the programs I’ll install, ~70GB. (/home?)
4. A partition for all my photos, music, documents, etc. Sized to occupy the remaining space on the hard drive, ~400GB. (/usr?)

I’ll be partitioning the hard drive using the Linux installer, unless there's a good reason not to?

My computer specs:
HP EliteBook 8540p
Intel i5-520M
8GB RAM

Questions
1. Did I leave out anything important? Any suggestions for improvement to this proposed partitioning scheme?
2. Naming convention: What do I call the partitions? What is the difference between naming a partition ‘/dev/sda2’ or ‘swap’ (for example). Some of the time the documentation refer to ‘/dev/xxxx/’ convention, and other times ‘/’,’swap’, ‘/home’, etc. It’s confusing.
3. Primary and logical partitions: Which partitions needs to be primary, which needs to be logical, and what is the difference between the 2?
4. File Systems: Which partitions need to have which file systems (ext2, ext3, ext4, FAT16, FAT32, NTFS, etc)? I’m guessing that the partition (4) above might need to be FAT/NTFS, so it can be read by Windows if need be?

Thanks in advance !
 
Old 06-14-2011, 04:37 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
These are all very good questions and I will try to shed some light on them for you.
The Linux file system is a flat file system with everything under / which is also known as root. In Windows, each partition, or logical drive, has a drive letter assigned to it such as C:, D:. This is not the case in Linux; it is all flat under the one structure. You have been doing some reading, which is great and I would recommend that you try to find some documentation on the layout of the file system. It does follow an organized pattern and once you "get it" it will make sense, though it will probably take a while till this just happens. Here is a great resource for you: http://ftacademy.org/materials/fsm/13 (the other resources on that site are good too but start with that).

Here is a short description of the major partitions:
/ Root, is the root of the file system, the base of the tree
/bin, /sbin contain binary application files, related to the system (sbin) and other functions (mostly utilities) /bin
/usr and /usr/bin, /usr/sbin, and the like under /usr are reserved for the user to install binary application files
/etc contains application configuration files. This will be one of the primary directories you learn to work in
/home contains all the home directories of the various users
/var contains information that will change often, such as log files
/dev and /proc are pseudo file systems. Everything in Linux is treated as a file, including the USB sticks, mouse, keyboard, etc. And these directories are associated with the hardware. Consequently, your drive partitions will appear under the /dev for device "files". /dev/sda1 is the first partition on the first drive, /dev/sda2 is the second and so forth. Similarly, /dev/sdb1 and /dev/sdb2 will be the first and second partition on the second hard drive.

My recommendation would be to create the following: / and make it moderately sized. 20-50 GB should be sufficient. /home make fairly large. You can have multiple users in the /home space and if you install multiple distributions, each will need a separate / partition, but you can share /home (just use different users and you will have no conflicts). I would also create some swap space. Back in the old days of little memory, 1-2x you phyiscal memory was good. These days it is a waste. I would recommend 1-2 GB of swap space as more than sufficient. Unless you start running a lot of applications or virtual machines you probably won't be wanting for physical memory.

Your / /home, etc can be what ever file system you would like. Generally speaking, Linux users go with the EXT (or extended file system) with EXT4 being the latest incarnation. EXT is what is called a journaling file system which isn't subject to fragmentation like FAT or NTFS. If you want to share between Windows and Linux, you can use a USB Stick or a SAMBA server or whatever. I wouldn't worry too much about creating a FAT or NTFS partition just to share stuff between. Linux can read the NTFS and you can always work from there to move between the hard drives.

The above partitions would be on your new drive (for Linux). Create the three partitions and install Linux after Windows. This is called Dual Booting. It will put a new boot loader on your primary drive and partition (with Windows) and let you select between the operating systems. If/When you decide you want to remove Windows, you can remove the drive and update your boot loader to point to your remaining drive. Linux is very forgiving and adaptable about hardware changes.

Lastly, with IDE and SATA drives you can have some many (4) primary partitions. Beyond this you need extended partitions, where your last primary partition becomes a shell that holds all the other Logical partitions. Nothing really too it, it is just a way to get more than 4 partitions on a drive.

Hope that helps, but if not, ask away.
 
1 members found this post helpful.
Old 06-15-2011, 01:22 PM   #3
Stefaans
LQ Newbie
 
Registered: May 2011
Location: Belo Horizonte, MG, Brasil
Distribution: Ubuntu
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks Noway, you've given me a lot to chew on, let me give it a bash!

Cheers!
 
Old 06-15-2011, 03:50 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello Stefaans,

most things are said in this thread.

About the swapspace, you'll need at least as much swapspace as your RAM if you want to use the "suspend to RAM" function. If you don't I'd recommend up to 256MB of swap or none at all.

I use a big separate partition which I mount as /usr/local/public for every distribution I'm running. Every user (only me) has his own directory in /usr/local/public, Here as an example my output of ls -lh in the /home/markus directory:
Code:
markus@samsung:~$ ls -lh
total 1.7M
-rw-r--r-- 1 markus users  107 Apr 30 22:16 2
drwx------ 2 markus users 4.0K Jun  4 21:50 Desktop/
lrwxrwxrwx 1 markus users   29 Apr 28 22:00 Doc -> /usr/local/public/markus/Doc//
lrwxrwxrwx 1 markus users   35 Apr 28 21:59 Dokumente -> /usr/local/public/markus/Dokumente//
lrwxrwxrwx 1 markus users   35 Apr 28 21:59 Downloads -> /usr/local/public/markus/Downloads//
lrwxrwxrwx 1 markus users   36 Apr 28 21:59 Geocaching -> /usr/local/public/markus/Geocaching//
lrwxrwxrwx 1 markus users   37 Apr 29 15:06 MeineBilder -> /usr/local/public/markus/MeineBilder//
lrwxrwxrwx 1 markus users   40 Apr 28 21:59 Programmierung -> /usr/local/public/markus/Programmierung//
lrwxrwxrwx 1 markus users   32 Apr 28 21:59 Videos -> /usr/local/public/markus/Videos//
drwxr-xr-x 4 markus users 4.0K May 11 22:54 VirtualBox\ VMs/
the symbolic links point to the directories which I use from every distribution. But my /home directory is not very big, mostly I use about 8GB, yet I've 15GB, it's only to store the configuration files. Here my output of df -h
Code:
markus@samsung:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        35G   16G   18G  48% /
/dev/sda8        15G  7.5G  6.7G  53% /home
/dev/sda9        50G   25G   22G  54% /usr/local/public
/dev/sda6        60G   40G   17G  71% /usr/local/vm
/dev/sda10       66G   10G   53G  16% /usr/local/vmwin
/dev/sda3        51G   41G   11G  80% /usr/local/win7
tmpfs           2.0G  156K  2.0G   1% /dev/shm
If you want to install only Linux on the new harddrive, I'd recommend only to use one extended partition with logical partitions on it , they are much more flexible than primary partitions. Nowadays primary partitions are only good for Windows, here my partitiontable
Code:
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    31459327    15728640   27  Hidden NTFS WinRE
/dev/sda2   *    31459328    31664127      102400    7  HPFS/NTFS/exFAT
/dev/sda3        31664128   138487807    53411840    7  HPFS/NTFS/exFAT
/dev/sda4       138487808   625137344   243324768+   5  Extended
/dev/sda5       138487871   211897349    36704739+  83  Linux
/dev/sda6       498241958   625137344    63447693+  83  Linux
/dev/sda7       211899398   222139397     5120000   82  Linux swap
/dev/sda8       222141446   253598725    15728640   83  Linux
/dev/sda9       253600774   358458373    52428800   83  Linux
/dev/sda10      358460422   498239909    69889744   83  Linux
I've repartitioned this disk several times, I ran OpenBSD, FreeBSD, Arch, Gentoo and Slackware as well as Windows on the machine, yet only Slackware and Windows 7. The partitions are not in disk order.

Markus

Last edited by markush; 06-16-2011 at 09:07 AM. Reason: made a mistake
 
1 members found this post helpful.
Old 06-16-2011, 07:57 AM   #5
Stefaans
LQ Newbie
 
Registered: May 2011
Location: Belo Horizonte, MG, Brasil
Distribution: Ubuntu
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks Markus

I probably won't (at least initially) have more than one distro installed. Glad to hear I can make all the partitions logical, I wasn't too sure about that.

Cheers!
 
  


Reply

Tags
partitioning



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need partitioning advice Morik the Rogue Linux - General 8 03-13-2010 09:26 AM
LXer: Archos releases unrestricted Ubuntu netbook with 500GB, 2GB RAM and 6-cells LXer Syndicated Linux News 0 06-17-2009 10:41 AM
large 500gb hard disk partitioning issue Mr Marmmalade Debian 7 11-21-2007 05:13 PM
Partitioning help/advice drlinux Linux - General 12 08-25-2006 06:06 AM
Need partitioning advice lancelott Linux - Newbie 1 06-11-2004 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 AM.

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