View previous topic :: View next topic |
Author |
Message |
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Wed May 09, 2012 11:59 am Post subject: [SOLVED] SSD + 2HDD partitioning help. |
|
|
Greetings. I've just purchased a 64GB SSD and a 1TB caviar black. I have the following:
sda is the SSD
sdb is the caviar black
sdc is my storage hdd
I want to use sda just for system, sdb just for software installation and sdc as storage.
The problem is I don't know how to split gentoo system (in sda) and portage installations (in sdb). Any advice?
Thanks.
Last edited by Eurt on Mon May 14, 2012 5:23 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Wed May 09, 2012 6:07 pm Post subject: |
|
|
Eurt,
Put /boot, / (root) and /usr on the SSD.
You don't need a separate /boot if you don't want it.
/ is the top level of the filesystem tree, /usr is where you system binaries go.
Swap here will be fastest but you may never need swap. You should have 512Mb of swap anyway, or swap=RAM if you want suspend to disk.
You can make separate partitions on your second drive for /var and /usr/portage and even /usr/portage/distfiles and /usr/portage/packages. I'll come back to /var in a minute
/usr/portage contains a large number of very small files. You can save space by making the block size 1k. Most of the files in the treee are smaller than that. If you use a 4k block sixe, you need four times as much space for your portage tree. Set the inode to block ratio to 1.
packages and distfiles contain mostly large tarballs, use a filesystem with 4k blocks and a lot of blocks per inode.
A separate /var may turn out to be a curse as newer udev needs it to be mounted before udev starts.
Put /home on either /dev/sdb or /dev/sdc
If you thing you will want to move space around, look into using Logical Volume Manager. My system looks like Code: | $ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
rootfs rootfs 15475372 844504 13842900 6% /
/dev/md126 ext4 15475372 844504 13842900 6% /
/dev/dm-0 ext4 41240944 20959668 18184380 54% /usr
/dev/dm-3 ext4 60882824 28680568 29109624 50% /var
tmpfs tmpfs 8207916 496 8207420 1% /run
rc-svcdir tmpfs 1024 84 940 9% /lib64/rc/init.d
cgroup_root tmpfs 10240 0 10240 0% /sys/fs/cgroup
udev devtmpfs 10240 4 10236 1% /dev
shm tmpfs 8207916 80 8207836 1% /dev/shm
/dev/mapper/vg-home ext4 1056952092 750175164 253089840 75% /home
/dev/mapper/vg-opt ext4 10299412 529040 9246084 6% /opt
/dev/mapper/vg-tmp ext2 2046355 3109 1938389 1% /tmp
/dev/mapper/vg-local ext4 1033516 65572 915516 7% /usr/local
/dev/mapper/vg-portage ext2 2046355 366014 1575484 19% /usr/portage
/dev/mapper/vg-distfiles ext4 61881956 34707224 24029388 60% /usr/portage/distfiles
/dev/mapper/vg-packages ext4 61881956 25397292 33339320 44% /usr/portage/packages
/dev/shm tmpfs 8207916 0 8207916 0% /var/tmp/portage
/dev/md125 ext2 38792 23491 13298 64% /boot | as I have a 4 disk raid set with most things in logical volume manager. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Wed May 09, 2012 7:06 pm Post subject: |
|
|
The problem is that sda (SSD) will be shared by Windows and Gentoo, half and half, so I don't want to install every piece of software portage compiles into the ssd as I only have 30GB for each OS. My intention is to place just lib files in the ssd and the rest at another hdd. Should I mount /usr at sdb and /usr/lib32, /usr/lib64, /lib32, /lib64 at SSD?
By the way, thanks for the info |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Wed May 09, 2012 7:33 pm Post subject: |
|
|
Eurt,
/lib, /lib32 and /lib64 must be on the root filesystem as programs in /sbin need them.
Consider what mount will do if its libraries are not on root. It will fail and nothing will mount.
You really don't want to split up /usr, other then moving portage out. You can have a separate /usr if you wish but this will lead to extra complexity when you move to >=udev-182.
What is your real objective in splitting up your system this way - what do you hope to achieve? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Wed May 09, 2012 7:46 pm Post subject: |
|
|
My target is to have this distribution:
sda (SSD) -> system
sdb -> programs
sdc -> storage |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Wed May 09, 2012 8:57 pm Post subject: |
|
|
Eurt,
OK - but why? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Wed May 09, 2012 10:01 pm Post subject: |
|
|
Because I only have nearly 30GB for gentoo and to minimize writing to the ssd. I'll be using gentoo daily, as main OS (programming, studying...) and use windows just for gaming. That's why I think 30gb for installing programs won't be enaugh. |
|
Back to top |
|
|
Arkhelion Apprentice
Joined: 07 Sep 2010 Posts: 151 Location: France
|
Posted: Thu May 10, 2012 6:32 am Post subject: |
|
|
Hi,
I seriously have a hard time seeing how you could even approach 30GB for a root fs in Gentoo. If you keep your /home separated (absolutely no point to put it on an SSD), then 30GB is just huge!
For instance, I just checked my whole desktop system at home is 16GB and that's adding portage FS, logs, database files. Let's say (because that's what we are) you want to compile LibreOffice with your choice of USE flags you need an extra 10GB that'd make 26GB...
If you want to keep far from that, you could put your portage files on a separate partition like NeddySeagoon said. Now if you wanna install heavy softwares on your system, maybe games, you can always symlink /usr/games so that it won't clutter your root fs. _________________ Arkhelion |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Thu May 10, 2012 6:20 pm Post subject: |
|
|
Eurt,
My root plus /usr, without /usr/portage is 22G and I will have a few G of kernels in /usr/src, which can be moved out with a symlink, so say 20G.
Your 30G for root plus /usr looks fairly safe.
Why put gameloader OS on SSD if thats all it will be used for? The OS speed is not important there, its game data loading speed you are interested in. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
SDNick484 Apprentice
Joined: 05 Dec 2005 Posts: 231
|
Posted: Thu May 10, 2012 9:02 pm Post subject: |
|
|
I have a laptop (Lenovo T400) with a similar setup sda is a SSD and sdb is a HDD. Beyond the recommendations in the thread, I also suggest making /tmp (and possibly /var/tmp/portage) to be tmpfs. I have 8 GB on this laptop and this setup works well for me. It also has the advantage of reducing a number of small writes/erases on my SSD while still giving a performance boost. I have a 4 GB swap file, but I rarely hit it. I started using /tmp as a tmpfs after admining Solaris for a number of years (it's the OS default there). |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Thu May 10, 2012 9:19 pm Post subject: |
|
|
Thanks for your answers, I'm building a good idea with those
NeddySeagoon wrote: | Why put gameloader OS on SSD if thats all it will be used for? The OS speed is not important there, its game data loading speed you are interested in. |
OMG, that really cleared my mind... You're right, why would I need gameloader to run fast... Installing games at the caviar black will give me enaugh speed.
Keeping in mind what you told me, I have the following idea right now:
SSD -> sda (64GB)
caviar black -> sdb (1TB)
storage -> sdc (1TB)
/dev/sda1 /boot ext4
/dev/sda2 / ext4
/dev/sdb1 C: NTFS
/dev/sdb2 Extended
/dev/sdb3 /home ext4
/dev/sdb4 /usr/portage ext4
/dev/sdb5 /usr/portage/packages ext4
/dev/sdb6 /usr/portage/distfiles ext4
/dev/sdb7 /var ext4
/dev/sdb8 /tmp ext4
/dev/sdc1 /mnt/storage NTFS --> That will be shared with windows and gentoo, I'll put music, photos, downloads, documents... That kind of things in there.
I'm in the right path?
Thanks. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Thu May 10, 2012 9:26 pm Post subject: |
|
|
SDNick484 wrote: | I have a laptop (Lenovo T400) with a similar setup sda is a SSD and sdb is a HDD. Beyond the recommendations in the thread, I also suggest making /tmp (and possibly /var/tmp/portage) to be tmpfs. I have 8 GB on this laptop and this setup works well for me. It also has the advantage of reducing a number of small writes/erases on my SSD while still giving a performance boost. I have a 4 GB swap file, but I rarely hit it. I started using /tmp as a tmpfs after admining Solaris for a number of years (it's the OS default there). |
That's something I'm thinking right now. I have 6GB, I think it should be fine. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Fri May 11, 2012 5:19 pm Post subject: |
|
|
Eurt,
/tmp on tmpfs is good, /var/tmp/portage is actually less important. If you have the RAM, the -pipe CFLAG has almost the same effect. That has the benefit of not invoking the OOM manager if you think you have enough RAM for /var/tmp/portage in tmpfs but really you don't.
All /var/tmp/portage in tmpfs gives you is the bragging rights to claim you can compile libre office in RAM and right now that needs 16G RAM. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
SDNick484 Apprentice
Joined: 05 Dec 2005 Posts: 231
|
Posted: Fri May 11, 2012 7:23 pm Post subject: |
|
|
NeddySeagoon wrote: | Eurt,
/tmp on tmpfs is good, /var/tmp/portage is actually less important. If you have the RAM, the -pipe CFLAG has almost the same effect. That has the benefit of not invoking the OOM manager if you think you have enough RAM for /var/tmp/portage in tmpfs but really you don't.
All /var/tmp/portage in tmpfs gives you is the bragging rights to claim you can compile libre office in RAM and right now that needs 16G RAM. |
While I don't disagree about what you say regarding -pipe, using tmpfs for /var/tmp/portage does have the benefit of not burning write/erase cycles to the SSD (less wear & tear). Also other parts of the build besides compiling (i.e. uncompressing the distfiles, etc.) are also faster (obviously -pipe doesn't help with stuff like that). With 8 GB RAM + 4 GB swap, I never had the problem of the OOM killer waking up despite setting /var/tmp/portage to 7 GB however I also don't compile libreoffice from source (and if I do, I'd just umount /var/tmp/portage and do it on disk). With a SSD, libreoffice-bin opens fast enough that I don't see much point in building it from source. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Fri May 11, 2012 9:28 pm Post subject: |
|
|
Great info in this thread, seriously. Thanks everyone .
I just did not realize something really important...
I'm using gentoo right now on my laptop as main OS, which actually is the only OS living in my 250GB HDD.
I'm analyzing disk usage with xdiskusage right now. Even though I have my system daily updated, with lots of programs, /usr just weight 14.74GB, I don't need anything more in my laptop so my PC /usr partition should weight at least the same. The other one is /home, which weights 50GB. That would be out of the SSD on my PC so isn't a problem. Finally, I have 11.53 GB occupied by inodes, which I actually have no idea of what they are. The rest of folders are irrelevant, they don't even appear in the graphic. So, keeping in mind that I'll be using about 15Gb of my SSD, I can install the gameloader in the SSD too. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Sat May 12, 2012 10:58 am Post subject: |
|
|
Eurt,
An i-node is a block of 128b or 256b, (its a filesystem creation option) used to store data about files. Each file needs at least one i-node, so you can get out of disk space errors either because you have no i-nodes left or the partition is full. Its space on disk the filesystem uses to store data about the files.
Some filesystems, e.g. the extX series, preallocate this space, others, e.g. reiser allocate space for this task as files are created.
The inode to data blocks ratio is set at filesystem make time and connot be changed.
For /usr/portage (just the tree) one inode per block is good as most files are smaller then one block
For /usr/portage/distfiles, which stores largw files, one inode per 1000 blocks may be ok. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Eurt Tux's lil' helper
Joined: 18 Nov 2007 Posts: 86 Location: Cádiz, Spain
|
Posted: Mon May 14, 2012 5:22 pm Post subject: |
|
|
Thanks again! You all really solved my problems. |
|
Back to top |
|
|
gcyoung Apprentice
Joined: 04 Jul 2007 Posts: 170 Location: England
|
Posted: Thu Oct 04, 2018 6:51 pm Post subject: SSD drive |
|
|
Have just aquired an SSD disk and have studied all of the above, and found it to be most helpful, Thanks to all.
I enquired of the vendor what the block erase size was and he didn't seem to know what that was, let alone the size itself.
Can anyone tell me if and how this can be obtained from the disk itself, or must I try and get this from the manufacturer ?
Also:--
Systemd and various other changes have taken place since the above was discussed. I note that on my current setup /dev /dev/sh /run and /sys/fs/cgroup are all installed (by gentoo), as a 'tmpfs's and /var/tmp/portage needs a minimum of 3.1G to function. There seems to be far more use of ram than formerly.
I don't see why /dev should not be placed on a secondary drive to spare some ram for /var/tmp/portage, since I am limited to 8Gig ram.
Any views/comments would be appreciated? |
|
Back to top |
|
|
|