LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-16-2009, 12:20 AM   #1
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Rep: Reputation: 34
partitions, sata drives, and compiling


I don't know that I'm a beginner, exactly, but I consider myself a far cry from an expert Linux user so I suppose I will post here.

1) I'm trying to make sense of all the different opinions I read. What is a good partition strategy? It looks like a swap space is never supposed to be larger than 512MB? Is that true? So even if I have 2MB RAM my swap partition should only be 512MB?

What is swap space anyway? Does the OS use it to store stuff it can no longer fit into RAM or something?

Suppose after partitioning swap space I have 150GB left. How much for /, /home, and /usr/local? I understand that a /home partition lets you update your linux version more easily but what is /usr/local?

2) You can ignore this question, it is distro specific, but I will post it in case you know the answer off the top of your head. I installed Slackware 12.0 on one computer with a SATA hard drive. I used fdisk /dev/sda. Now I tried to install it on another computer with a SATA hard drive and Slackware will not detect it. Why? From reading in forums all I can find is that maybe it has something to do with RAID? I don't know. I am now downloading Slackware 12.2 and I will see if it detects the hard drive. Who knows.

3) This is my favorite question. I just read the "read before you post" links in this forum. It sort of covered this question. I know how to download source code, type ./configure, make, make install.

Let me make sure of this: It is important to NOT log in as root when you do ./configure and make, correct? And then when you do make install you should log in as root, correct?

Also what directory are you supposed to put those programs into? I always thought you were supposed to put a new folder in the / directory. Is that wrong? On the "read before you post" link it says to put them in the /home/username directory. Then will other users be able to use the program?

What about packages? Do you put them in the /home/username directory as well? No, you have to log in as root to install packages, correct? So where should they be installed?
 
Old 02-16-2009, 01:06 AM   #2
Ranguvar
Member
 
Registered: Oct 2008
Location: Upstate NY
Distribution: Arch Linux
Posts: 99

Rep: Reputation: 17
1.) Yes. Stuff that can't fit into RAM goes into swap. Make sure you have enough - try with a generous amount, and keep an eye on how big it gets, so you can shrink it later.
/usr/local is usually used to put apps you've compiled yourself into, that sort of thing.
I usually give Linux distros ~15GB (should be more than enough) for /, and as much as I can goes to home. Besides swap, I don't use other partitions.

2.) Check /dev/hd* too. Most distros now put everything as /dev/sd*, but Slackware has been odd for me.

3.) It is important to understand what that does. ./configure runs a script called 'configure' in that directory. ./configure --help will usually give you the options it accepts. Through this you can make apps compile with support for certain things, or without support for other things. This is also (usually) where you tell apps where to install. Most apps have a standard configure script, some small ones don't have one at all. make is a program that looks in the current dir for a file named Makefile. This file has rules in it. It says, basically, what commands to follow to compile, to install (make install), to uninstall (make uninstall), and to clean the directory of compiled or half-compiled stuff from a previous make (make clean). Not all Makefiles have all those options. configure and make should be run as user, yes (since root is not needed, don't use root), and make install (and make uninstall) need root access to install the compiled apps, etc. onto your drives. Make install can also be made to force where to install, but good apps can do this in the configure step. If you put programs into your home, other users won't be able to use the apps unless you give them permissions to your home. Usually, you want apps to install normally onto the filesystem. /usr/local/{bin,sbin,lib,etc.} is also used for this purpose. Since the reason you need root for make install is so you can put stuff on parts of the filesystem that only root has write access to (as it should) (if everyone did, you wouldn't need root for this), if you install stuff into a dir owned by you, you don't need root privileges.

All that said, however, avoid doing a vanilla compile and install whenever possible, because you end up with files scattered across your drive with no fast, clean way to manage them. Make packages for your distro whenever possible (Slackware SlackBuilds).
 
Old 02-16-2009, 01:19 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
There is no partitioning strategy as such. You can partition your hardrive as you want. Make sure you have required partitions.
I guess there is no such requirement that Swap always be 512mb. It is used by OS when it runs out of physical memory. Usual practice is to keep swap twice the physical memory. But if you have system high on ram say 4gb you should never need that amount of swap. My desktop has 2gb ram and same amount of swap and it is seldomly used.

You are correct about your third question. You do not need to be super user for running configure script and make. But you need those permissions when running make install.
If you want other users to allow the access to the programs, then it is not a good idea to put it in home folder of the user. You can use /opt or /usr for that. If you want user based installations then you can put them in home folder.
The binaries that you install are usually installed /usr/bin, /usr/sbin and others as well. It depends. And yes you have to be super user to install packages.
 
Old 02-16-2009, 01:39 AM   #4
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Original Poster
Rep: Reputation: 34
thanks

Thank you.

I have Slackware 12.2 and it dectects /dev/sda on my ASUS motherboard computer. (the one I was talking about)

Slackware 12.0 will NOT find /dev/sda on that computer. I have no idea why. It detected it on my MSI motherboard computer but not the ASUS one. I don't know if it's the different hard drive or different motherboard or something to do with RAID or what. But since 12.2 works I guess it doesn't matter anymore.

If I do 15MB for / and as much as I can for /home then how much for /usr? I know there is no correct answer but I don't have a clue.

My best guess is 15MB for /, and then split what remains for /home and /usr.
 
Old 02-16-2009, 04:08 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
That may be something to do with the kernel versions. Slack 12.2 has a newer kernel and that could be one reason that it detects your drive. Also 15 MB seems too low for /.
You are not low on space. Give it a nice space. Also it is not necessary to have /usr on different partition. /home on different partition is a good thing to do so that you can always retrieve user data if you have system crash. And /boot on different partition if you like.
 
Old 02-16-2009, 03:17 PM   #6
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
@icecubeflower: I think you mean 15 GB, not 15 MB.

When you put /usr into a special partition this in fact has some disadvantages:
for example the package splashy that shows nice boot splash screens upon boot is mounting / in the initrd script before regular boot and then look in /usr/share/splashy/themes/... for its images.
When /usr is on a separate partition, the images aren't found and you get no splash, but instead some nice irritation error messages...

The idea behind putting /usr in a special partition is to give it the advantage of bein on another disk and thus
two disk heads can move independently when files on / and /usr are accessed. But if you are not on a server with big simultanous load, you wouldn't mind this either.

/home on a special partition has another advantage: the linux disk quota system can only be set on a per-partition (_and_ per-user) base, not on a directory base. Say, when you want user "sister" to have max. 10GB, but you yourself want to have "all-the-rest" of your data area, you could set up quotas for the /home partition.

HTH,
Florian
 
Old 02-16-2009, 03:34 PM   #7
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Original Poster
Rep: Reputation: 34
Oh yeah I meant 15GB. Also I meant /usr/local, not /usr.
 
Old 02-16-2009, 03:43 PM   #8
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
For /usr/local even more it doesn't make much sense to be a separate partition.

As Ranguvar stated
[X] you rather seldom want to compile applications yourself, but instead use binary packages or at least create distribution packages (*.deb, *.rpm, *.whatever) instead.
 
Old 02-16-2009, 04:16 PM   #9
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Original Poster
Rep: Reputation: 34
Are you sure it makes no sense for /usr/local to be on its own partition? I understand everybody has different opinions on this stuff but is there really a right and wrong answer? The Slackware book, the Slackware website, and even the Slackware installer say putting /usr/local on a separate partition is a good idea. I understand people may disagree with that but I have a hard time believing the Slackware guys are all out wrong.
 
Old 02-16-2009, 04:24 PM   #10
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
Of course, there may be reasons, my posts can only reflect my opinion...
Maybe someone else could post his opinion on this, I would like to hear other reasons or ideas about partitioning, as I have to set up a new server in the next weeks...
 
Old 02-16-2009, 04:33 PM   #11
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

To use '15GB' for '/' is a lot of space since you stated that '/usr' was to be on another partition. If you place both '/usr' and '/home' on separate partitions then the '/' requirement will be less than '1GB'.
The setup for one of my systems;

Code:
~# cat /etc/fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda5        /                ext3        defaults         1   1
/dev/sda6        /home            ext3        defaults         1   2
/dev/sda7        /usr             ext3        defaults         1   2
/dev/sda8        /var             ext3        defaults         1   2
/dev/sda9        /tmp             ext3        defaults         1   2
/dev/sda1        /mnt/winxp       ntfs-3g     umask=000        1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
Code:
fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf5b5f5b5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3824    30716248+   7  HPFS/NTFS
/dev/sda2            3825        4074     2008125   82  Linux swap
/dev/sda3            4075       10300    50010345   83  Linux
/dev/sda4           10301       60801   405649282+   5  Extended
/dev/sda5           10301       10425     1004031   83  Linux
/dev/sda6           10426       11671    10008463+  83  Linux
/dev/sda7           11672       12668     8008371   83  Linux
/dev/sda8           12669       12918     2008093+  83  Linux
/dev/sda9           12919       13915     8008371   83  Linux
/dev/sda10          13916       15161    10008463+  83  Linux
/dev/sda11          15162       16407    10008463+  83  Linux
/dev/sda12          16408       28856    99996561   83  Linux
/dev/sda13          28857       41305    99996561   83  Linux
/dev/sda14          41306       53754    99996561   83  Linux
/dev/sda15          53755       60801    56604996   83  Linux
Code:
                                    cfdisk (util-linux-ng 2.13.1)

                                         Disk Drive: /dev/sda
                                  Size: 500107862016 bytes, 500.1 GB
                         Heads: 255   Sectors per Track: 63   Cylinders: 60801

     Name           Flags          Part Type    FS Type               [Label]            Size (MB)
 -----------------------------------------------------------------------------------------------------
     sda1           Boot            Primary     NTFS                  [^C]                31453.48
     sda2                           Primary     Linux swap                                 2056.32
     sda3                           Primary     Linux ext3            [/spare1]           51210.60
     sda5                           Logical     Linux ext3            [/]                  1028.16
     sda6                           Logical     Linux ext3            [/home]             10248.70
     sda7                           Logical     Linux ext3            [/usr]               8200.61
     sda8                           Logical     Linux ext3            [/var]               2056.32
     sda9                           Logical     Linux ext3            [/tmp]               8200.61
     sda10                          Logical     Linux ext3                                10248.70
     sda11                          Logical     Linux ext3                                10248.70
     sda12                          Logical     Linux ext3                               102396.52
     sda13                          Logical     Linux ext3                               102396.52
     sda14                          Logical     Linux ext3                               102396.52
     sda15                          Logical     Linux ext3                                57963.55
Notice that my '/tmp' is rather large. I do a lot of device intensive work therefore my needs for '/tmp' are high on this particular system.

Partitioning is a personal taste along with requirements for the system usage. If your wanting the server scheme then that will be a totally different setup compared to a desktop.

You could do a LQ search and find a lot of information on partitioning along with file system use.
 
  


Reply



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
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
SATA drives and SATA DVD drives archangel_617b Linux - General 3 11-07-2007 10:36 AM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM
new partitions on new hard drives Sticktendo Linux - Newbie 18 01-01-2005 04:16 AM
How to mount drives and partitions Larriemac Linux - Newbie 1 07-24-2004 08:02 PM

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

All times are GMT -5. The time now is 08:01 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