LinuxQuestions.org
Visit Jeremy's Blog.
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 01-22-2009, 09:18 PM   #1
errorsunknownp
Member
 
Registered: Dec 2008
Location: Nepal
Distribution: Slackware
Posts: 61

Rep: Reputation: 15
Smile Disk Partition


I know that only two partitions "/" and "swap" is sufficient to install
linux. I am doing the same.

I think that it is possible to separate usr,lib,share,local, and several
other directories in different directories. I'm confused is it possible?

If it is possible then what should be the minimum size of each partition?
I'm using 240 GB of Hard Disk?
 
Old 01-22-2009, 09:41 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Technically all you need is /, but having a swap is a good idea of course . Generally you don't need to split them off unless you really know why you are doing it. For some of the VPSs I manage, I generally I split off /, /tmp, /boot and a swap partition. I split of /tmp since mainly dealing with servers as a I do it's a very good idea to lock /tmp down as much as possible to help protect against rootkits (I have seen other people's servers get compromised by /tmp in the past). I keep /boot seperate for management over grub.

Really you can go right down into different mount points on the hard drive but you should know exactly why you are doing it, else wise just leave it as standard you won't really notice anything other then not having a SWAP.
 
Old 01-23-2009, 01:28 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
For a desktop, with a single user, I would recommend having /, swap and /home. Having a separate /home partition will allow you to reinstall and by not reformatting /home, retain your old data. I'd recommend changing the name of your home directory (such as adding -old to the name). Then you can move documents from your old home directory to your new one.

Some distro's use a different UID number range so you may need to use "chown" to fix that if you go from Fedora to SuSE for example.
 
Old 01-23-2009, 10:51 AM   #4
catworld
Member
 
Registered: Nov 2004
Location: Horseheads, New York
Distribution: Mandriva 2010.1 / KDE 4.5.2, Slax, Knoppix, Backtrack & etc...
Posts: 198

Rep: Reputation: 36
240 GB hard drive... here's what I'd do.

First, decide what the function of the computer is. If it is going to be a server (web, ftp etc) then I will weight partitions more toward /var at the expense of /home.

But you're probably talking desktop. So here's how I would do that drive:

5 GB / (root) this is where boot info, e.g. kernel live
1 GB swap ...more if you plan to suspend/hibernate
9 GB /usr where apps are installed. 9 GB is hard to fill...
5 GB /var on this drive, a server would get 100 GB from me...
the rest /home - 5 GB for a /tmp>
5 GB /tmp

on occasion I make a /var/www or /var/ftp separate, makes it easier when doing reinstalls or upgrades, you can choose not to format and save everything. (same with separate /home)

Bare minimum:

50 GB /
1 GB swap
190 GB /home

I prefer to separate partitions as above. I've found it makes maintenance, troubleshooting and pulling off miracles much easier.
 
Old 01-23-2009, 11:29 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

My question to 'catworld' is why so much for '/' since you are allocating partitions for '/usr', '/tmp' and '/var' along with a '/home' partition? The space requirements for root would not be 5GB with the scheme you suggest but wasted space. That is unless this is intended to be a testbed with things in 'opt'. But even then 5GB is a lot of space for 'root'.
 
Old 01-23-2009, 11:44 AM   #6
catworld
Member
 
Registered: Nov 2004
Location: Horseheads, New York
Distribution: Mandriva 2010.1 / KDE 4.5.2, Slax, Knoppix, Backtrack & etc...
Posts: 198

Rep: Reputation: 36
Yes, for options. Custom kernels, multiple systems (on other drives in e.g.)

Couple of months ago I had a 4 GB / and attempted to upgrade a Mandriva system to 2009 and the root was full, it was no go even after trying to remove whatever I could get away with. Had to repartition everything. Never again. (used to happen all the time in the 20 GB drive era...)
 
Old 01-23-2009, 05:30 PM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

Yes, the moving between systems may create that scenario. I have a testbed setup like this;

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             966M  185M  732M  21% /
/dev/sda6             9.4G  258M  8.7G   3% /home
/dev/sda7             7.6G  3.9G  3.3G  55% /usr
/dev/sda8             1.9G   68M  1.8G   4% /var
/dev/sda9             7.6G  146M  7.0G   2% /tmp
/dev/sda1              30G  9.4G   20G  33% /mnt/winxp
tmpfs                 884M     0  884M   0% /dev/shm
/dev/sdd2              38G   25G   11G  70% /media/Linux_Archive
My '/tmp' is large because I do a lot of work with 'iso' and other large images. The cost per byte has really gone down. I'm spoiled with todays hdd systems. I can remember my first hdd that was 10MB and I thought I was in heaven. At that time floppies were great, much better that tape. But when I got my hands on that 10MB hdd things were fast as compared to floppy or tape. I'm spoiled!
 
Old 01-23-2009, 05:46 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,750

Rep: Reputation: 271Reputation: 271Reputation: 271
The overall size of a Linux distribution is usually less than 4 Gig plus swap of about 1 Gig plus the size of your user data.

/boot is pretty small. Mine is about 16 Meg. In the days when I used a separate /boot I used 512 Meg.

/home is also fairly small when first installed. It can increase in size significantly if you have a lot of user data.

/usr takes about half of your system space. My /usr uses 1.6 Gig out of a 4 Gig partition.

/var holds log files and some package managers store downloaded packages in the /var cache. Right now without any downloaded packages my /var uses 175 Meg out of a 4 Gig partition. Servers will use a lot more log space and you will also use up more /var space when you are making major software upgrades.

/opt is not used by some distributions. If your distribution does not use /opt then a /opt partition is a waste of space. If your distribution uses /opt then it will put about 40% of /usr in /opt. So if you use /opt then make /opt about 1.5 Gig and /usr about 2.5 Gig.

I have a 1 Gig swap partition which is more than enough. If you start swapping a lot your system will slow down dramatically. You will either buy more RAM or cut down your RAM demand. The only time that swap size is significant is if you use the suspend to disk function. Then you need a swap size of about 1.5 times your RAM size.


You can use the du command to find out how much space a directory tree is using. The command to find out how much space /home is using is:

du -s -h /home

-----------------------
Steve Stites
 
Old 01-23-2009, 05:55 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,275

Rep: Reputation: 126Reputation: 126
Quote:
Originally Posted by errorsunknownp View Post
I know that only two partitions "/" and "swap" is sufficient to install
linux. I am doing the same.

I think that it is possible to separate usr,lib,share,local, and several
other directories in different directories. I'm confused is it possible?

If it is possible then what should be the minimum size of each partition?
I'm using 240 GB of Hard Disk?
Any directory entry can be a partition. Whether it's useful to split them out is a different story. For a home user, I'd put 20GB in "/" and the rest in a new "/data" partition. Commercial server admins generally know what they will need where, and have different needs from the home user, anyway.

Some find it useful to split out "/home", but I have my doubts, especially in a situation where you're multi-booting and decide to try to share that "/home" with all your Linux distros. I prefer to have all my data in one place and let each distro have it's own /home. If you decide you need to reload, it's simple enough to run "rsync -a /home /data/home" or something like that, in order to save your "/home" directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How Do I Partition The Disk And Install DSL To Disk? Novatian DamnSmallLinux 2 05-16-2008 06:31 AM
Disk Partition Resize Trouble and Partition Questions GNewbie Linux - Newbie 2 11-15-2005 05:15 PM
Copy files from partition to partition too slow, SATA hard disk.What should I doŁż Ryanlee SUSE / openSUSE 20 10-31-2005 08:30 AM
Reclaim disk partition from hard disk installation EStester Linux - Enterprise 2 03-09-2005 12:46 PM
Reclaim disk partition from hard disk installation EStester Linux - General 1 03-09-2005 12:25 PM


All times are GMT -5. The time now is 05:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration