Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
Last edited by PleaseHelpMeUnderstand; 05-20-2016 at 10:10 AM.
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.
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 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
Last edited by PleaseHelpMeUnderstand; 05-20-2016 at 11:19 AM.
Ok thank you. What should I have input for the 1st sector since I put 15M? I didn't understand & honestly was 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
yes just hit enter for first sector. there are plenty of guides how to use fdisk, like this
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
Last edited by PleaseHelpMeUnderstand; 05-20-2016 at 12:20 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.