[SGVLUG] newbie qu: HDD partitions
Emerson, Tom
Tom.Emerson at wbconsultant.com
Fri Jul 29 18:29:21 PDT 2005
It's too bad we don't have archives available from our 'old' list [though I may have some old messages on one machine or another...] because this topic came up years ago ;)
> -----Original Message-----
> Behalf Of Jeff Kutz
>
> My question is what would be the smartest way to partition
> the 20 GB hard
> drive. The author talks about partitions but it seems more like
> subdirectories that he is talking about. The way I read the
> book he would
> have me putting in some half-dozen partitions. I am coming from the
> DOS/Windows world. Am I missing something here in the transition?
Not really -- One way of thinking of this is that each partition is like a seperate drive (yet at the same time it's all part of "one big drive") so seperate partitions would be like having drive C: for the OS, D: for user files, and E: for the swapfile.386 file [or whatever it's called nowadays] Outside of "swap" space in particular, though, "drive letters" go away and everything appears under the root level [C: for you dos thinkers]
Since drive letters don't exist, you need some way of relating a partition to "where it is" in the hierarchy of "your disk storage" -- these are what are known as "mount points" and yes, they are in reality subdirectories, which leads to some of the confusion.
But, that also allows for a little more control over what happens and where. For instance, you may see recommendations for creating a relatively small partition (in particular, "near the front of the disk") and "mounting" it as "/boot". Part of the reason is technical: this "partition" will contain the files needed to actually boot the system. Years ago, when disks started growing faster than the OS could deal with them, there was a limitation that the "boot code" had to reside within the first 512 tracks of the drive -- by forcing a small partition to reside "at the front" of the disk, you could guarantee that the boot code would end up in the first 512 tracks.
One big difference between Unix partitions and DOS partition/drives is that you can mount a partition "read only" -- for example, if you have a web server that serves truly "static" pages (or rarely changed pages) you could mark the partition the web server uses for it's "document" directory as "read only", then not worry (too much) about someone "hacking" your site since even if they could find an "exploit" (and thus "deface" your site by placing alternate content on your server), the system itself would keep the web server daemon from overwriting the "document" files. (to update your site, you would have to use the "remount" option to mark it writable for the brief period in which you actually save the file, then mount it "read only" immediately afterwards)
> He talks about where I might run into a situation like a DOS
> attack and I
> could suddenly get a truly huge collection of log files that
> would fill up a
> partition and block other functions that need some disk room
> to operate.
It doesn't have to be an "attack" -- I once started a program that "backgrounded" itself and wrote output to (of all places) the X-server's log file. I basically "screwed up" the startup parameters, but didn't know it at the time -- I just thought it died and tried again. Three days later the system semi-crashed when all disk space was consumed (it still "ran", but things were just "not quite right" -- that's when I figured out that the program didn't crash, but instead actually ran and was writing a page of output every 30 seconds...)
> If you are starting from scratch, with a dedicated Linux
> laptop, how many
> partitions would you build and what would you establish in
> each one? Would
> I maybe want three partitions, one for data, one for the OS and
> applications, and one for swap and log files?
That's as good a starting point as any, though "swap" will be a partition of it's own [it doesn't really have a "file system" on it, or rather, the "swap file" is it's own "file system"] You MIGHT want to read up on "lvm" [logical volume manager] and related items as this allows you to dynamically resize partitions should you "chose wrong" the first time you try.
More information about the SGVLUG
mailing list