Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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).
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.
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.
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.
@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.
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.
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.
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...
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;
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.