Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Quick advice on partitioning SSD for Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 329

PostPosted: Sun Oct 30, 2016 3:28 am    Post subject: Quick advice on partitioning SSD for Gentoo Reply with quote

Hi... I'd just like to say that I'm not looking for detailed help, necessarily, but just want to test the water :)

I've got an SSD (Samsung 850 EVO 250GB) that I want to swap into my old Thinkpad. I've been trying to read up on partitioning and so on - how to set up an SSD correctly - and a lot of the info on the web seems old-ish... still I'm taking it seriously. Trying to figure out how to partition properly on an erase block size boundary, etc.

I must say, it's really making my head hurt. I can't find what seems to be straightforward advice about how to proceed. Is there any such thing as straightfwd advice on this question? The drive is now close on 1 year old, because I've been too preoccupied with other things to install it. Do I even need to worry about such technicalities for an SSD bought in 2015? Does it matter whether I use fdisk or cfdisk or parted? Should I drive myself crazy to get the performance tuning just right when the machine is already old enough that the performance boost of just having an SSD will blow me away, and anyway I'll probably be replacing the drive before it gets worn out?

Any high level help on these questions is much appreciated, for the time being :)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7130
Location: almost Mile High in the USA

PostPosted: Sun Oct 30, 2016 4:01 am    Post subject: Reply with quote

If you have a newish fdisk (probably with the past 5-8 years or so), it will handle this automatically, just make sure you're using LBAs and partition on 1MiB boundaries (instead of C/H/S sector boundaries) which should be default. Parted should handle this automatically as it uses MiB boundaries. Even if you didn't do this, you probably wouldn't notice much of a difference anyway, it's those 4K sector mechanical HDDs that really hurt if you don't set it up just right. What you want is to make sure the clusters on your filesystem do not straddle a write block boundary. I don't think there's anything you really can do about erase boundaries anyway as over time you'll still have to do garbage collection.

Yes you'll likely waste some space between the first/boot block and the first partition, but it's less than 1MiB...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?


Last edited by eccerr0r on Sun Oct 30, 2016 4:03 am; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Sun Oct 30, 2016 4:02 am    Post subject: Reply with quote

Alignment is easy, just round to 1MiB and it's almost guaranteed to be aligned. First partition starts at sector 2048, etc. In my experience getting GPT right is more hassle than getting alignment right...

It's worth doing it right, you only have to do it once after all.
Back to top
View user's profile Send private message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 329

PostPosted: Sun Oct 30, 2016 4:14 am    Post subject: Reply with quote

Thanks for the replies. Follow up:

What are LBAs?

I found this post that vaguely suggests to me that my erase (write?) block size might be 1.5MiB. Should I take that very seriously?

"Start first partition at sector 2048" sounds like the kind of concrete advice I'd like to get :) but does that number depend on number of heads and/or sectors per track or something? I'm generally pretty good with numbers, but this stuff makes my head spin...
Back to top
View user's profile Send private message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 329

PostPosted: Sun Oct 30, 2016 4:19 am    Post subject: Reply with quote

Ant P. wrote:
In my experience getting GPT right is more hassle than getting alignment right...

I don't know if I should read into this, but I'm setting this up as an MBR partition, not GPT.
I tried GPT on another install on a different machine recently (HDD, not SSD), and could not get the thing to boot (find its root partition, if I recall). Gave up on GPT after getting advice on the forum. This is a different machine, but older than the aforementioned one.


Last edited by Punchcutter on Sun Oct 30, 2016 5:01 am; edited 1 time in total
Back to top
View user's profile Send private message
mjbjr
Apprentice
Apprentice


Joined: 02 Mar 2003
Posts: 233

PostPosted: Sun Oct 30, 2016 4:58 am    Post subject: Reply with quote

you may want to take a look at...

https://wiki.gentoo.org/wiki/SSD

http://chmatse.github.io/SSDcronTRIM/

https://sites.google.com/site/easylinuxtipsproject/ssd
Back to top
View user's profile Send private message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 329

PostPosted: Sun Oct 30, 2016 5:44 am    Post subject: Reply with quote

Finding some good info by continuing to search the Net, and even what looks like a very good post from this very forum. Will follow up with those links after I've had a chance to digest it and get my own job done. Thanks again.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7130
Location: almost Mile High in the USA

PostPosted: Sun Oct 30, 2016 9:34 am    Post subject: Reply with quote

Most hard drives use Linear Block Addresses (LBA) which each block on the disk can be referred to a single number instead of a cylinder, head, sector (CHS). CHS has not really made sense for many years now but kept for legacy purposes. LBA ignores the real geometry of the disk and just gives each block a number and by definition the 2048th block of 512 byte blocks is 1MiB, and 1MiB is a multiple of most write and erase block sizes of SSDs and definitely a multiple of 4096 bytes for "advanced format" HDDs, thus making things aligned. As long as you stay on multiples of 1MiB you'll keep alignment.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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