Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partition size based on sector size...
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
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Fri Dec 12, 2014 1:46 pm    Post subject: Partition size based on sector size... Reply with quote

I received what I believe to be fairly good advice (alright, really good advice) for partitioning my laptop, which has 4k sectors. However, now that everything is installed and working, less the KDE desktop effects, I don't seem to be using much space. For example, I remember that /usr/portage should be 2GB if I can use 1k block size or 8GB if I use 4k block size. My laptop obviously has 4k sectors so I used 4k blocks and an 8GB partition, but I am barely using it, even with everything on my system.
Code:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       3.8G  293M  3.5G   8% /
udev             10M  4.0K   10M   1% /dev
/dev/sda8       7.8G  4.2G  3.6G  54% /usr
tmpfs           391M  1.0M  390M   1% /run
shm             2.0G     0  2.0G   0% /dev/shm
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
/dev/sda4       2.0G  341M  1.6G  18% /var
/dev/sda5       2.0G   19M  1.9G   1% /var/cache
/dev/sda6       9.8G   23M  9.6G   1% /var/tmp/portage
/dev/sda7       976M  5.3M  945M   1% /var/log
/dev/sda9       7.8G  860M  6.9G  11% /usr/portage
/dev/sda10       24G  2.8G   21G  12% /usr/portage/distfiles
/dev/sda11      9.8G   23M  9.6G   1% /usr/portage/packages
/dev/sda12      4.0G  8.1M  3.9G   1% /tmp
/dev/sda13      3.9G  1.1G  2.7G  29% /usr/src
/dev/sda15      493G   70M  487G   1% /vm
/dev/sda16      345G   13G  329G   4% /home

Note that all of my partitions use 4k block sizes and are aligned.

Now, my boss absolutely loves my new setup and wants it on his laptop. His also has a 1TB disk, but his has 512b sectors. What is recommended for the following partitions as far as capacity and block-size?
Code:

/var/tmp/portage
/usr/portage
/usr/portage/distfiles
/usr/portage/packages

I am still learning about portage, but I can see that I am barely using my current setup even though I have 4k sectors/blocks. I was hoping to use a tad less space since I have a smaller sector size on his system. What do you think?
_________________
Ever picture systemd as what runs "The Borg"?


Last edited by The_Great_Sephiroth on Fri Dec 12, 2014 5:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Fri Dec 12, 2014 5:37 pm    Post subject: Reply with quote

I seem to have an odd issue here. I went ahead and created a partition layout like mine, but with smaller block sizes since the boss' laptop has that 512b sector size. I chrooted and am trying to do "emerge-webrsync" and I am being spammed with "rsync: /usr/portage/********* no space left on device". All partitions on the laptop are showing 1%~16% usage. The portage partition is 8GB with a 2k block size and is only using 299MB of space, the rest being free. What would cause rsync to believe the space is used? I have checked with "df -h" and it reports 7.7GB free. If I run "du -h" is reports 299MB also. I have not experienced this one before!

*UPDATE*

I just thought about it and checked inodes. I am maxed out. How the heck did this happen and how can I fix it?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43192
Location: 56N 3W

PostPosted: Fri Dec 12, 2014 9:15 pm    Post subject: Reply with quote

The_Great_Sephiroth,

You are goind to hate all those partitons very soon. if you need a lot of divisions, LVM is the way to go.
That way you allocate space to a logical volume os you need it.

mke2fs guesses the space to inode ratio depending on the filesystem size. To optimise a filesystem for the ebuild tree, you need to set one inode per 1kb of space on the filesystem.
Code:
man mke2fs
is the required reading. You will need to remake the affected filesystem(s).
OK its guesses come from /etc/mke2fs.conf

Incidently, you can do this on a drive with 4k physical sectors. The read speed in hardly affected due to the read ahead but the write speed will be reduced, which will slow emerege --sync.
Beware of 1Tb drives advertising 512B physical sectors. They almost all have 4kb physical sectors but lie about it to the operating system.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Sat Dec 13, 2014 3:30 pm    Post subject: Reply with quote

This drive has 512b physical though. I always check with fdisk and I actually looked the drive up and it is stated to have 512b physical sector size, not logical. I always cover my butt when dealing with sector sizes, especially in RAID situations.

Also, I did read up on the man page after posting and I am about to start experimenting with the "-i" parameter. My system with 4k physical sectors and 4k blocks has over four times as many inodes as the other one. I'll figure it out I am sure, but I always like hearing from the seasoned veterans as I begin my own journey.

Oh and the partitions are to keep fragmentation to a minimum. I try to isolate partitions which are read/written frequently from those which are not. Has worked GREAT for years (15+ actually) and the only systems I have had to wipe and redo were my first ones where I made one big partition. They also suffered fragmentation problems, which was no big issue initially because prior to ext3 we had e2defrag. I do know that ext* is resistant to fragmentation, but it happens all the time.

Think of the logs directory. I have two files, A and B. They're each 1MiB in size, and they're next to each other. A has some data appended so it is written past the end of B. Now B has some data written. It is appended past the end of A's new data. That alone is my case for isolating logs! I am sure it happens in portage and the build directory as things get updated and such also.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43192
Location: 56N 3W

PostPosted: Sat Dec 13, 2014 5:05 pm    Post subject: Reply with quote

The_Great_Sephiroth,

LVM lets you allocate space as you need it and move space around when both a logical volume and physical volume is full.

This may mean that some lodical volumes are allocated non contiguionsly when they are grown.
On the plus side, on rotating rust, you use the outer (faster) zones first.

Logs get rotated and deleted so fragmentation is not really important.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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