LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-25-2014, 02:48 PM   #1
munna529
LQ Newbie
 
Registered: Apr 2014
Posts: 17

Rep: Reputation: Disabled
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?
 
Old 07-25-2014, 04:51 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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...
 
1 members found this post helpful.
Old 07-29-2014, 09:00 AM   #3
munna529
LQ Newbie
 
Registered: Apr 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks T3RM1NVT0R. I had few doubts but your reply made it clear thanks.
 
Old 07-30-2014, 12:59 AM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're welcome. Please mark the thread as solved!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a raw disk bootable TKH Linux - Virtualization and Cloud 5 07-01-2013 07:47 PM
Writing data to a raw disk using dd barunparichha Linux - Software 3 02-09-2012 02:26 PM
LVM to Raw Disk ? ahamed_135 Linux - Server 2 07-21-2010 04:09 PM
How to view raw content in a disk? fjkum Linux - Newbie 6 03-23-2009 05:09 PM
Is this raw disk setup correct? pgb205 Linux - Server 0 11-14-2007 06:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:53 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