LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-20-2013, 04:16 PM   #1
frisil
LQ Newbie
 
Registered: Feb 2010
Location: behind you ;-)
Distribution: SimplyMepis
Posts: 17

Rep: Reputation: 1
Please help setting up partitons with 4096 sector size alignment


Hi,
my harddrive broke down so I got a new one, and I decided for a new start from scratch and to try to do everything right this time. I tried looking up partition alignment, but couldn't figure it out, sorry, too much contradicting infos out there. Never cared for these things in the past but writing/reading has always been rather slow. So I want to do better this time.

My new drive is a toshiba 2tb and according to gsmartcontrol it uses the following sector sizes at the moment: 512 logical / 4096 physical. So I'd like it to actually use 4096 and properly allign the partitons for it. How do I switch the drive to use 4096 logically?

This is the partiton table I'd like to create:

partition 1: 10 GB Linux (reiserfs) for my Backup and boot/control System
partition 2: 6 GB swap

then use a logical volume for the remaining space of the disk with the following partitons:

partition 5: 50 GB Linux (whatever type) for testing new distros
partition 6: 50 GB Linux (ext4) for productive system (newest Mint)
partition 7: 50 GB Linux (whatever type) for secondary Linux (probably debian but not sure yet)
partiton 8: remaining drive space Linux (reiser) for data storage to symlink (some) home folders to

I've done setups like these often so I know the basic steps, but I never cared for alignment.

Can anyone please tell me how to set this up WITH proper partition alignment and using 4096 sector size?

Thanks for any help in advance.
 
Old 03-20-2013, 05:39 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
You really do not want to use a BS of 4096

yes you can do it , but
512 or 1024 and a few partitions is much better


but if you want
The current Gparted can do it

but not every OS can use a 4096 size
 
1 members found this post helpful.
Old 03-20-2013, 05:42 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Use gptfdisk, it will do it automatically for you. You can create GPT partition table with it and it will work fine with BIOS motherboard (as long as Windows is not involved).
 
1 members found this post helpful.
Old 03-20-2013, 05:47 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You don't try to change the logical sector size. It takes a very new kernel and tool set to even work with 4096 byte logical, and even then it is very much bleeding edge. You just keep the 512 byte logical size and make sure that every partition starts on a logical block address that is a multiple of 8. Modern partitioning tools, such as gparted, default to 1-Megabyte alignment, which is fine. The most likely way to go wrong would be to use an old tool like fdisk and work in "cylinder" units. That's pretty much guaranteed to cause misalignment unless you are very clever. (Recent versions of fdisk default to "sector" units and start the first partition at sector 2048, which is 1 Megabyte into the disk.)

After you've done the partitioning, you can check by running "fdisk -l -u" and verifying that each starting sector number is a multiple of 8.
 
1 members found this post helpful.
Old 03-20-2013, 07:49 PM   #5
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Not only gptfisk as Emerson told you, but you can use gparted or even the cli parted which is pre-installed in most of current distros
Code:
root@i7:~# parted  /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA WDC WD10EARS-00Y (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size   File system  Name   Flags
 1      1049kB  734GB   734GB  ext4         linux
 2      734GB   1000GB  266GB               2

(parted) align-check opt 1                                                
1 aligned
(parted) quit                                                             
root@i7:~#
as you can see, partition 1 is aligned in a disk which has physical sectors size of 4096B.
 
2 members found this post helpful.
  


Reply

Tags
partitioning, partitionssize, partitiontable



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fdisk shows logical sector size smaller than physical sector size after clonezilla narnie Linux - Hardware 12 07-03-2013 09:01 PM
a question about "sector size 4096" Young_zhang Linux - General 10 11-28-2011 05:38 AM
How do I set block size to 4096 hotrock3 Linux - Newbie 4 03-27-2009 11:27 PM
The command to find the size of the partitons Gins Linux - General 18 10-29-2006 01:27 PM
Installing and don't know how many or what size partitons to make. Travis86 Linux - Newbie 14 05-23-2003 09:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration