LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating new partition (https://www.linuxquestions.org/questions/linux-newbie-8/creating-new-partition-4175580269/)

PleaseHelpMeUnderstand 05-20-2016 09:55 AM

Creating new partition
 
I need to create a partition 15MB in size on the 1st hard drive of my RHEL system

So far I typed:
fdisk /dev/sda <enter>
c <enter>
m <enter>
p <enter>
d <enter>
1 <enter>
n <enter>
p <enter>
1 <enter>
+15M <enter>
+15M <enter>

This is where I am getting hung up. When I try to go back to view the new partition table, I hit p <enter> and I now see /dev/sda1 and this displays:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-5221, default 1): +15M
Last cylinder, +cylinders or +size{K,M,G} (2-63, default 63): +15M

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005ac32

Device Boot Start End Blocks Id System
/dev/sda1 2 4 24097 83 Linux
/dev/sda2 64 5222 41430016 8e Linux LVM

I know I previously deleted the 1st partition so this new one I created (ID 83) is what I just did but why cant I see the size I input of 15MB? Did I input this incorrectly?

Thanks in advance for any assistance offered.

dab1414 05-20-2016 10:40 AM

Quote:

Originally Posted by PleaseHelpMeUnderstand (Post 5548240)
I know I previously deleted the 1st partition so this new one I created (ID 83) is what I just did but why cant I see the size I input of 15MB? Did I input this incorrectly?

Well not sure why you entered all those commands, but while running fdisk, afaik, will not show MB in the print screen, just blocks.

Here is how I would have done. ( I use the p alot to verify what i want to do and that is what happened)

Code:

fdisk /dev/sda
p
d <---assuming delete a partion
1 <---deletes partition 1
p
n
p <---primary partition
1 <---partition 1
return <---use first sector (you tried to tell it to go +15M which Ive never seen that syntax for first sector)
+15M <---last sector for the size you want
p
w

Now if i understood blocks correctly, simply divide that number by 2 and you would get number of 1024 bytes, or kilobytes.

But if you prefer seeing in MB or such, why not try cfdisk instead of fdisk.

PleaseHelpMeUnderstand 05-20-2016 11:17 AM

Quote:

Originally Posted by dab1414 (Post 5548264)
Well not sure why you entered all those commands, but while running fdisk, afaik, will not show MB in the print screen, just blocks.

Here is how I would have done. ( I use the p alot to verify what i want to do and that is what happened)

Code:

fdisk /dev/sda
p
d <---assuming delete a partion
1 <---deletes partition 1
p
n
p <---primary partition
1 <---partition 1
return <---use first sector (you tried to tell it to go +15M which Ive never seen that syntax for first sector)
+15M <---last sector for the size you want
p
w

Now if i understood blocks correctly, simply divide that number by 2 and you would get number of 1024 bytes, or kilobytes.

But if you prefer seeing in MB or such, why not try cfdisk instead of fdisk.

Ok thank you. What should I have input for the 1st sector since I put 15M? I didn't understand & honestly was :banghead: so I just put it for both first and last sectors since I wanted the size to be 15MB.

Ok so wait... are you saying to input NOTHING and just his return for the 1st sector? I don't think I understood you until I read it again:doh:

dab1414 05-20-2016 11:37 AM

Quote:

Originally Posted by PleaseHelpMeUnderstand (Post 5548283)
Ok thank you. What should I have input for the 1st sector since I put 15M? I didn't understand & honestly was :banghead: so I just put it for both first and last sectors since I wanted the size to be 15MB.

Ok so wait... are you saying to input NOTHING and just his return for the 1st sector? I don't think I understood you until I read it again:doh:

yes just hit enter for first sector. there are plenty of guides how to use fdisk, like this

PleaseHelpMeUnderstand 05-20-2016 11:49 AM

1 Attachment(s)
Quote:

Originally Posted by dab1414 (Post 5548293)
yes just hit enter for first sector. there are plenty of guides how to use fdisk, like this

After I did this, I hit w to write the table to disk and exited at which point I received a message that the new partition will be used at the next reboot... only at my desk reboot I now have a black screen (please view attachment) and can't do anything on it


All times are GMT -5. The time now is 06:05 AM.