# Changing Partitions Layout After Install

## th0r

I recently did a fresh install of Gentoo. But when I set up my fstab I did a partition layout like /dev/sda1 is boot /dev/sda2 is swap and /dev/sda3 is root. All free space going to root.Now that I think about it I kinda wanted to do a layout like that divides up the filesystem which I have seen before: ex. add in a separate partition for things like /dev/etc /var /opt and so on. Is it possible after an install to put the directories  on their own paritions? And if so is it good practice to do so. If there is a good layout for a 80Gb HD I'd like to see it as well.

----------

## defenderBG

there were quite a lot of post aboout paritioning, you can search and read them.

you can put everything in new partitions, provided that you have them, all you need to do is to start from the live cd, copy the directories to their new destination and then edit the /etc/fstab file and add them there.

For a partitioning sheme I would suggest:

/ - 8 GB

/var - 4 GB 

/usr/portage - 2GB with reiserfs or ext2

/usr - 6 GB

/bin - 6 GB

/home - everything else

Note that this I use for 320GB, which is somewhat more than 80GB and I use so much space, because I have too much software! Really too much.

/dev - i think you dont need it, since udev creates a virtual /dev partition. Do a "df -h" and you will understand.

----------

## th0r

Ok, I will take look. Thanks for the reply. Now I know it's not too much a hassle. I guess my reason for this is if something goes wrong on one partition it won't take down the whole system.  I remember reading somewhere that one of the partitions that is important will grow if it needed more room.  I think it was /root. Do you happen to have a recollection of what I'm talking about? 

Also, So I guess anything that is on /root will stay there after new partition scheme and If I want to move it I would do it manually right?

----------

## notHerbert

I think you mean /tmp.

----------

## th0r

/tmp makes more sense now that you mention it.

----------

## defenderBG

my /root has never grown!

the worst thing that can happen is the MBR to get lost, but there are tools, which almoast always can repair the MBR.

----------

## szczerb

I'm about to move /usr/portage and /var/tmp off / but, how do I copy things to preserve all symlinks (if there are any)?

Is 'cp -pR /usr/portage/* /mnt/new_portage/' good?

----------

## jstead1

/var can grow, depending on what you have on your system, since it is the place for things like logs.

portage uses /var (by default) for building packages, and for things like Ooo, needs several gigs.

/usr will grow from installing more packages

splitting up your system into more partitions only makes sense if it is to take advantage of something you want to do or to increase reliability or maintainablity.  

I like to separate things that change a lot (home, var, usr, tmp) from things that don't (root boot).  boot is also wise to keep on a separate partition (so it is not normally mounted).

The other reason to put things on a separate partition would be the nature of the data and performance.  tmp doesn't need journaling, some directories contain lots of big files (mp3's in home) and others lots of small files (usr/portage).  Some file systems work better with bigger or smaller files.

But none of these distinctions is worth running out of space on a partition.  Running out of space on root boot var or usr can be a big headache.  Even running out of space in home or tmp is  a big inconvenience. So if you are close on space, I wouldn't get too fancy with the partition scheme

----------

## th0r

Yeah I have alot of room on this drive that I want to do it on. So I don't think I will partition more than home, var, usr, tmp. My current setup is /boot/swap/root. Probably a familar setup with alot of home users. I haven't noticed performance defects but I would like to experiment with different file systems to see a difference.

----------

## szczerb

But how do I copy things to a new partition? What options to use with cp?

----------

## szczerb

Oh, come on guys I'm sure most of you know this ;] (don't make me start another topic on this   :Laughing: )

----------

## cyrillic

There are a bunch of ways to copy files, but the important thing to do is to preserve permissions on the files and directories.

Use something like "cp -a" or "rsync -a" or "tar -p" ... you get the idea.

----------

## bunder

Moved from Installing Gentoo to Kernel & Hardware.

----------

## th0r

Here is a linki dink about the cp command. It also answers the question about symbolic link copying. -L

http://www.computerhope.com/unix/ucp.htm

----------

