LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Disk Partitioning 1MB offset on raw disk (https://www.linuxquestions.org/questions/linux-newbie-8/disk-partitioning-1mb-offset-on-raw-disk-4175512285/)

munna529 07-25-2014 02:48 PM

Disk Partitioning 1MB offset on raw disk
 
Hi Guys

I know how to do 1MB offset on whole disk where only one partition is being held.

Fdisk /dev/sdb, "u" change to sectors, create new partition "n", primary "p" , select partition number "1" and first sector as 2048 and last sector default.

But if i like ot have multiple partition then how should i create 1MB offset for all partitions i am being dumb here please guide me.
Its 100g disk and if i want 4 partitions of 4gb size lets say how can i do it ?

Fdisk /dev/sdb, change to sectors "u", create new partition "n", primary "p", select partition number "1" and first sector as 2048 and last sector size : +4G (4194304) and create another partition 2 but here
what will be the first sector : ??? is it next value of previous sector? i.e 4194305?

Code:

  Device Boot      Start        End      Blocks  Id  System
/dev/sde1            2048    8390656    4194304+  83  Linux

Command (m for help): n
Command action
  e  extended
  p  primary partition (1-4)
p
Partition number (1-4): 2
First sector (2-209715199, default 2)

what should i select first sector when i want to create another 1 mb offset for second partition?

T3RM1NVT0R 07-25-2014 04:51 PM

First of call you can directly use: fdisk -cu /dev/sda or /dev/sdb whatever.

You said that you want 1 MB offset for all 4 partitions. Then your first partition with 1 MB offset starts with:

1st Partition -- Starting sector 2048 to Ending sector = 8388608+2048 = 8390656
(1 MiB = 2048 sectors, 1024 MiB (1 GiB ) = 2097152 sectors, which multiplied by 4 comes to 8388608, add another 2048 to 8388608 as you are starting the sectors from 2048 not 0)

2nd Parition -- Starting 8390656+2048 = 8392704 to ending sector = 8392704 + 8390656 = 16783360

This will go on...

munna529 07-29-2014 09:00 AM

Thanks T3RM1NVT0R. I had few doubts but your reply made it clear thanks.

T3RM1NVT0R 07-30-2014 12:59 AM

You're welcome. Please mark the thread as solved!


All times are GMT -5. The time now is 06:26 PM.