How to create one new partition in my hard disk in Linux?

0 votes

Hi Guys,

I want to create one new partition in my disk for my project. But I am not able to do so.

How can I do that?

Thank You

Apr 7 in Linux Administration by akhtar
• 10,230 points
36 views

1 answer to this question.

0 votes

Hi@akhtar,

To create new partition you can follow the below given steps one by one.

  • Enter the particular hard disk name.
$ fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x3f5179f6.
Command (m for help):
  • Enter n to create new partion.

  • Enter p to create primary partition.

  • Give size of the partition.

  • Save it with w.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-20971519, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +1G
Partition 1 of type Linux and of size 1 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
  • Update your partition table with the below command.

$ udevadm settle

Hope this will help.
Thank You

answered Apr 7 by MD
• 22,140 points

Related Questions In Linux Administration

0 votes
1 answer

How to create a symlink in Linux?

To create a symbolic link, you can ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,060 points
118 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,060 points
251 views
0 votes
1 answer

How to collect all output in one file?

You can use 2> to redirect it: foo ...READ MORE

answered Mar 1, 2019 in Linux Administration by ajs3033
• 7,280 points
71 views
0 votes
1 answer

How to find path of software installed in Linux?

There are multiple ways to find the ...READ MORE

answered May 19, 2019 in Linux Administration by Rishi
779 views
0 votes
1 answer
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24 in Linux Administration by MD
• 22,140 points
371 views
0 votes
1 answer

not able to run netstat-tnlp in Linux.

Hi@akhtar, In Linux system netstat-tnlp command comes from ...READ MORE

answered Apr 16 in Linux Administration by MD
• 22,140 points
24 views
0 votes
1 answer

How to break root password in CentOS/RHEL 8?

Hi@akhtar, Reboot the system and interrupt the boot ...READ MORE

answered May 11 in Linux Administration by MD
• 22,140 points
36 views
0 votes
1 answer

How to create one crontab job in Linux?

Hi@akhtar, To configure crontab in your system, you ...READ MORE

answered May 13 in Linux Administration by MD
• 22,140 points
47 views
0 votes
1 answer

How to install httpd web server in Linux?

Hi@akhtar, To install httpd web server in CentOS/RHEL ...READ MORE

answered Apr 21 in Linux Administration by MD
• 22,140 points
22 views