Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recommended advanced partition scheme
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Mar 08, 2006 1:38 am    Post subject: Recommended advanced partition scheme Reply with quote

Hello,

I am a new poster to this forum, but have used this forum as well as Gentoo for about 2 months now and love it! Anyway, I am here because I am considering redoing my installation for a more advanced and optimized approach to a partitioning scheme. As of yesterday, I had simply /boot, root, and swap partitions. I decided that because all I use Windows for lately is just some games, I'd get rid of the second drive I had in there and use it with Gentoo. Today, I added /usr/portage. /usr/storage, and /tmp to the secondary drive. I have some concerns about this setup, although nothing major, I still want to get a good solid partition scheme on here.

I'm not new to Linux, however I am a bit noobish when it comes to the different selections of filesystems. :oops: The only filesystem I've ever used on my desktops and servers was ext3. I read alot about the different filesystems, but still would be interested in what some other Gentoo users recommend for filesystem selections on the different partitions.

Anyway, getting down to business, here's the relevent computer hardware info. This PC has 3 drives, all identical 160GB SATA drives. sda is used entirely for Windows. sdb and sdc will be used for Gentoo. It will be used for gaming (some native, some with Wine/Cedega) and for general usage (internet, word processing, programming) on KDE. I'm looking to keep the filesystem's fragmentation as low as possible (hence I never used anything other than ext3 thus far), provide best performance (use two drives to balance the disk I/O), and be as safe as possible from corrupt filesystems (if a filesystem gets corrupted,

Here's the partition scheme I worked up so far (after some research on the sizes needed for portage and stuff):
Code:
/boot                        50MB
/                            2GB
/usr                         10GB
/usr/portage                 5GB
/usr/local/games             15GB
/tmp                         (tmpfs, variable)
/var                         10GB
/var/tmp                     (bind to /tmp (tmpfs, variable))
/var/tmp/portage             10GB
/home                        80GB+
/backup                      50GB+
swap                         4GB


Whatever's left over of the roughly 300GBs of usable space, will go towards a FAT32 shared partition for access between Windows and Linux.

I want to make sure that these sizes are big enough, but not overly excessive. Do you anticipate any problems with binding /var/tmp to /tmp (which will be noexec,nosuid,nodev), and having /var/tmp/portage mounted as a seperate partition? Is /var/tmp used alot for more than portage ebuilds?

Also, I tried to mount /tmp as a tmpfs on the install as it is now, however when I did so, KDE quit working when I'd try to login. I set permissions to 1777, but still failed. Once I unmounted it and restarted xdm, KDE worked fine. Anyone know what could be the culprit? In addition to /tmp mounted as tmpfs, I also read here that /var/lock and a few others can also be mounted as tmpfs safely to reduce disk usage and increase speed.

I have some time to revise this as input is given. I don't plan to re-install until the end of the month, but want everything ready to be ready for a fun-filled four years in college after the install, hehe. Until then, I'm very open to suggestions as far as this partitioning goes. Which partitions should be physically close to eachother on the disks for less head movement (say that sentence out of context and it sounds somewhat weird :roll: ). What filesystems should be used for each partition?

Thanks alot for any and all input!
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)


Last edited by BlueFusion on Wed Mar 08, 2006 11:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Wed Mar 08, 2006 2:44 am    Post subject: Reply with quote

My .02:

I installed a couple boxes following the standard file system plan the way you seem to be doing, maybe 3 or 4 years ago. I made new partitions for everything I could come up with a valid reason to make such a partition for.

I've fought that $@^#%$ thing ever since. It's a production server, so I can't just tear it down and start over at the drop of a hat. I run out of space on /tmp and have oodles somewhere else, then next week it's some other partition. The partitions seemed huge when I made them, but now it seems mighty tight in there.

IMHO, there is a need for:
- /boot
- /
- /home
- /tmp
-/opt (maybe)

If I could come up with a way to do it, I'd make all the user-accessible directories be on the same partition, and all the temp directories on the same partition, and maybe /var and /opt on a partition. Yes, partitioning public services off makes sense. However, I would find out how many types of partition I NEED, and then make the minimum number of partitions possible within those constraints. After you've updated a few times, and added a service or five, your "huge" partitions suddenly look pretty tiny, and other partitions might never actually be used.
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Mar 08, 2006 4:15 am    Post subject: Reply with quote

From my experiences, servers - mostly web servers - are more dynamic in the size of files because of continuous logging, growing databases, changing content, and more. Dekstops, atleast how I use mine, don't change much. Once the programs and games are installed, that's it until I need to update. The only exception to that are a few OO.o documents and ripping new CDs to my mp3 collection. Giving /home 80 gigs for just myself should be plenty as currently I am using less tahn 20 for all that and then some.

The other partitions, I ran against what I am currently using and added a percentage based on file growth. With my system set up as I want it now, I have the following usage:
Code:
area51 / # du -h --max-depth=1
8.0K    ./.links
4.3M    ./sbin
4.0K    ./media
36M     ./root
898M    ./proc
1.1M    ./tmp
6.4M    ./bin
16K     ./lost+found
0       ./sys
183M    ./opt
15G     ./home
24K     ./mnt
288K    ./dev
179M    ./var
5.6G    ./usr
17M     ./lib
4.0K    ./boot
8.5M    ./etc
21G


So with the partition scheme I made up above, I'm adding almost 10GB to /usr, almost 10 for /var, a ton for /home, hopefully up to 6GB for /tmp and /var/tmp (excluding /var/tmp/portage) with RAM and swap together. I gave /usr/portage a over a gig of what it is currently using (not including distfiles) for future package additions.

From what I've seen, the partitions have plenty of space, but don't know what the future holds. Don't feel your $0.02 went for nothing. I do appreciate the input alot and will consider it as I do some more research on this (and hopefully get other input).
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Wed Mar 08, 2006 4:36 am    Post subject: Reply with quote

You know, one thing that might work out OK is using a more advanced file system that uses automatically growing partition sizes. Be careful on that though because some of those file systems assume you have some pretty spiffy hardware to prevent file system damage. I might take a look at XFS if you have the hardware to support it, or that one IBM released. JFS?

My biggest issue with a million partitions is that of wasted space in one spot and not enough in the other. Having a dynamic file system allocation pool would solve that problem. Another thing that would help is if we could change the standard directories around so we could combine partitions based on our own scheme. There may be a way to do that with Gentoo, but as yet I have not found it, probably because I haven't looked if for no other reason.

By the way, I don't expect you to change your whole outlook based on my experiences. I only added that post to offer a different perspective. It sounds like you've been around, and while I see a real value in having critical system partitions separate from user-writable ones, and those separate from the ones service dynamic files are on, I have seen little practical need for it unless you've got a high visibility arrangement.

That said, I'm going through the security-related stuff now and doing my best to implement that stuff, both for my security and for an educational experience.
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Wed Mar 08, 2006 4:56 am    Post subject: Reply with quote

What about using lvm? I use it on several of my boxes at home and at work.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Wed Mar 08, 2006 5:01 am    Post subject: Reply with quote

I've never tried a growing-partition scheme on Linux. I won't make a recommendation on specific ones because of that. If it works, then great, I'll probably try something like that some time soon too after I hear enough happy users.
Back to top
View user's profile Send private message
brazzmonkey
Guru
Guru


Joined: 16 Jan 2005
Posts: 372
Location: between keyboard and chair

PostPosted: Wed Mar 08, 2006 9:24 am    Post subject: Reply with quote

here's what i use :
/boot about 100 Mb
/ 2 Gb (could be much less)
/var 5Gb
/usr 4Gb
/usr/portage 2Gb (could be less)
/usr/portage/distfiles 5Gb (still got plenty of space on that one)
/var/tmp 4 Gb or so
/tmp is tmpfs
/opt is 2Gb but barely used (i'm not a gamer)
swap 1xRAM (1Gb)
/home is up to you so it's not relevant here

in my opinion there's no point in having a separate /root, a separate /opt may be interesting if you're a gamer, / can be as small as 1 Gb (assuming /opt /usr /var and other are separate), /usr/portage could be about 1 Gb if the distfiles have their own partition.

i don't know if it's very safe to put /var/tmp in RAM...
Back to top
View user's profile Send private message
pv
Tux's lil' helper
Tux's lil' helper


Joined: 25 Mar 2005
Posts: 103
Location: Russia, Yaroslavl

PostPosted: Wed Mar 08, 2006 7:11 pm    Post subject: Reply with quote

Hi, all!

I have a question.

I'm going to change the partition scheme of my disk to something like
Code:
/dev/hda1    swap     2G
/dev/hda2    root     8G          ext3
/dev/hda3    misc     <the rest>  ext3

and then make as follows:
mount /dev/hda3 to /mnt/misc
mount --bind /mnt/misc/home /home
mount --bind /mnt/misc/tmp /var/tmp/portage
mount --bind /mnt/misc/portage /usr/portage

Why I do it in such a way is I don't really need a ~8+6G root partition (in my current installation it's about 5G) but they say one needs about 6G of free space in /var/tmp/portage while emerging openoffice. So if I allocate 8+6G for root partition the latter 6G won't be used after openoffice is emerged. But somewhen I probably will need more space for /home directory as well as I'd like to allocate a separate partition for /home to simplify reinstallations.

The question is whether using --bind is safe enough meaning a possibility of simultaneous disk access with full data journalling enabled (data=journal) or something else. Using --bind instead of a symlink is because I'd like to
Code:
chmod 0000 /mnt/misc/
not to allow everybody to access to /home/ or to /var/tmp/portage/.
_________________
Nothing but perfection.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Wed Mar 08, 2006 9:15 pm    Post subject: Reply with quote

pv wrote:
Hi, all!

mount /dev/hda3 to /mnt/misc
mount --bind /mnt/misc/home /home
mount --bind /mnt/misc/tmp /var/tmp/portage
mount --bind /mnt/misc/portage /usr/portage



Hmmm.

I'm REALLY curious about this approach and its safety. I was just whining in this very thread about needing a million little partitions which could just as well go on a few partitions if only we could change the location of the directory in question. It never occurred to me to do what you've just described even though I did it during the install process.

So my question is, is this safe to do for normal everyday use?
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Mar 08, 2006 9:36 pm    Post subject: Reply with quote

Emerging OpenOffice really uses 6 gigs of space in /var/tmp/portage when compiling? Was it possible for brazzmonkey to emerge openoffice on the 4GB /var/tmp partition (if he has OO.o installed)? I was really hoping to mount /var/tmp/portage (or just /var/tmp and all subdirs) on a tmpfs to just use RAM. I'm going to experiment with that when I get home to see if it is possible to emerge openoffice with /var/tmp/portage as tmpfs and see if I have enough space. I really want to use tmpfs more often because the most RAM usage I've seen on this new system in Gentoo is no more than 15% of the 2GB. Want to use it to get ever more performance :) .

In the meantime, I guess I really have no use for a /root partition as I rarely ever put stuff in there. I removed that from the partition scheme proposal at the top in the first thread.

EDIT:
The mounting with --bind should be safe. I don't see any problems with it and on all my Linux boxes (not Gentoo :( ), I have /var/tmp mounted with bind on /tmp. Works fine for everything, and this shouldn't be any different. Note, however, that if you use the bind mountpoints with alot of I/O, you may see some performance loss. I never saw it happen, but in theory it would. Using a file as a filesystem, however, will prove a tremendous letdown for performance goers. If you make a file and mount it with loop, you will notice performance loss, high IOWAIT and load if accessed alot.

And LVMs were also mentioned above. LVMs are nice for growing data storage, however I stay away from LVMs because of how the data is stored accross disks. It will use the first drive to write new data until it is full, and then write new data to the second drive until it is full, and then write new data to the third drive until it is full, and so on. LVM, atleast from my experinces and research, tends to have a much higher level of fragmentation. Additionally, if a drive's filesystem goes, or the drive itself goes, you're LVM will have a huge hole in the data it lost. I rather do special partitioning so if the /usr/portage filesystem gets FUBAR'd from an rsync gone wrong, I don't lose everything on root, /usr, etc. All that's lost is /usr/portage. Simple to fix, too. Just reformat the partition, do an emerge sync and your on your way with one less thing to worry about. If it's a whole drive failure, however, you're still probobly SOL, no matter how you use it, unless it's RAID 1, but I'm too ;azy to figure that stuff for now :-P .

Don't take my word for it on the LVMs, though. If you use LVM and like it, don't take this as I'm saying it's a stupid way to do things. I just stated the reason why I don't use it based on what I've seen. You may praise it, and that's cool, too.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
xgregx
Apprentice
Apprentice


Joined: 17 Dec 2004
Posts: 181
Location: Cheshire, CT

PostPosted: Wed Mar 08, 2006 9:52 pm    Post subject: Reply with quote

Mounting /tmp as a tmpfs file system can have it's draw backs. If you're creating and destroying lots of small files in /tmp, then it's probably going to work well for you, but if you're on a desktop burning CDs and DVD's or video edting, you might run into a problem when your burning software wants to write a 600 MB temp ISO file in /tmp before it burns it. That'll chew up lots of memory until it's cleared out.

You can also create an LVM volume group using both of your extra disks. The problem using 2 different disks for a volume group is like doing raid striping, if one disk dies, you lose the whole volume group.

I would make 2 volumes groups, one on each disk. Then you can resize any of the partitions when you feel like it. Everyone has their way of slicing partitions, we can talk about it for days. :)
That's my $0.02

Greg
_________________
Half-life/Source/Urban Terror/Unreal control panel -> www.opengamepanel.org
Linux user #347899
Gentoo has USE flags for a highly configurable system.
Microsoft has SUE flags to stifle innovation
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Mar 08, 2006 10:08 pm    Post subject: Reply with quote

With 2GB of RAM, it should be OK for CD-burning. I don't do any DVD-burning. Although, what's nice about using tmpfs instead of just creating a ramdisk is that it will spill the data over to swap, so in essense, it will work as though /tmp was on disk anyway. It would be a little slower when using swap for a simulated ext3fs, but it would still be better than having small files written to disk all the time.

But I still can't figure out why I can't get KDE to work when /tmp is mounted tmpfs. If I can't figure that one out, I won't be mounting /tmp as tmpfs anyway. I still hope atleast I can mount /var/tmp(/portage) as tmpfs to maybe even slightly speed up compile times (no disk reads/writes for the actual compilation) and once it's done and I reboot (I usually shut down at night because it has LED fans and is in my room) anything left be hind is gone, so no wasted space from the builds that were cancelled and whatnot.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
RuiP
l33t
l33t


Joined: 15 Jan 2005
Posts: 643

PostPosted: Wed Mar 08, 2006 11:12 pm    Post subject: Reply with quote

hi, just my 2c:

My /usr/portage is not even 1G and is not full.
The important point to do it small is to check for enough inodes, cause is full of plenty small files.

The most important i think when choosing a partition scheme, imho, is to set partitions for what they'll be used, choosing file system according,
as an example i use:
/boot -> ext2 (journal for what?)
/usr/portage -> ext2 (journal it every time i sync)
/usr/portage/distfiles -> xfs (large files)
(and where i save ocasional isos and other large tar.gzs)
/home -> ext3 (save^3 :))
/ -> ext3 (used to be reiserfs, but fragment a lot and i never find any speed burst)
/var -> ext3 (i use it to /usr/src too. lot of small files too, it contains important portage files so it's journalized)

I compiled my OOo-2.0.1, 2 or 3 days ago, on only 4G (it says 6G but that is probabily case you choose both kde and gnome flags)

emerge with /var/tmp/portage mounted as tmpfs to increase speed is just a nice, safe, myth. Check Gentoo wiki (search for temerge) for a discussion on that, and try for your self ;)

have fun.
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Mar 08, 2006 11:37 pm    Post subject: Reply with quote

Thanks for the info RuiP. Good read on the wiki, by the way. So tmpfs for /var/tmp/portage is not going to happen. But besides that, do you suggest mounting /tmp and /var/tmp (/var/tmp/portage on disk) as tmpfs in a KDE environment? If I can figure out why KDE won't start when /tmp is tmpfs, I'd like to atleast do that.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
xgregx
Apprentice
Apprentice


Joined: 17 Dec 2004
Posts: 181
Location: Cheshire, CT

PostPosted: Thu Mar 09, 2006 3:09 pm    Post subject: Reply with quote

KDE and Xorg put a bunch of stuff in tmp. They make directories too. Make sure regular users can write there. I did an rm -rf /tmp to clean up my temp dir the other day. When I booted up the next time, kde and xfce4 wouldn't load. It was b/c root took full ownership of /tmp when I deleted everything and my regular user couldn't create the files and directories that Xorg and KDE needed make in order to start.
_________________
Half-life/Source/Urban Terror/Unreal control panel -> www.opengamepanel.org
Linux user #347899
Gentoo has USE flags for a highly configurable system.
Microsoft has SUE flags to stifle innovation
Back to top
View user's profile Send private message
RuiP
l33t
l33t


Joined: 15 Jan 2005
Posts: 643

PostPosted: Thu Mar 09, 2006 3:20 pm    Post subject: Reply with quote

hi again.
in order to work well, /tmp must have permissions set to 1777.
If one remove the folder (for cleanning or by mistake) root must create one, but permitions must set for that (everybody can read and write).

mount at start up requires at fstab:
Code:
none         /tmp    tmpfs    defaults,noexec,size=500M,nr_inodes=8k,mode=1777  0 0

choose your size and nr_inodes, but, again, mode=1777.

I never tried with kde, but if you have enough space and the correct permitions it should work.
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Thu Mar 09, 2006 8:16 pm    Post subject: Reply with quote

I knew about the mode 1777, but forgot you can put that in the mount options. I was doing it manually after boot in a console. I'll try it with that now and see how it works out.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Thu Mar 09, 2006 8:46 pm    Post subject: Reply with quote

This worked. The inintial start of KDE is slightly slower since it has to write the data to /tmp, but thereafter it's just fine.

Here's what I have on my current installation for this:
Code:
none                    /tmp            tmpfs           noatime,noexec,size=500M,mode=1777 0 0
/tmp                    /var/tmp        tmpfs           noatime,noexec,bind,mode=1777   0 0
/dev/sdb4               /var/tmp/portage        ext3    noatime         1 2


A new question I have is how can I have the /var/tmp/portage directory created each time /var/tmp is mounted? To have /var/tmp/portage mounted, I need to create the /var/tmp/portage directory first. Any easy way to do that? I checked the mount manpage and didn't find any options relating to that for tmpfs.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum