LinuxQuestions.org

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

johnsonkv91 01-03-2012 04:28 AM

creating new free space partition
 
I want to create New free space partition in ubuntu
how can i create it. anyone who know this steps
if you. thanks in advance



Thanks,
Johnson

Satyaveer Arya 01-03-2012 05:43 AM

Have you tried searching on google? Try searching on google and if you face any problem in creating partition then we are here to solve the problem.

Well, I am giving you a link, try this:
http://www.easy-ubuntu-linux.com/ubu...ion-606-9.html

johnsonkv91 01-03-2012 10:48 PM

Quote:

Originally Posted by Satyaveer Arya (Post 4564529)
Have you tried searching on google? Try searching on google and if you face any problem in creating partition then we are here to solve the problem.

Well, I am giving you a link, try this:
http://www.easy-ubuntu-linux.com/ubu...ion-606-9.html





Tanks

but, sir i want to create partition by command line (CLI)
i have already tried it (GParted). I think fdisk is the command but i dont know how it is use...?

Regards
Johnson

Satyaveer Arya 01-03-2012 11:14 PM

Ok then, do as follows:

Suppose you have /dev/sda disk

First start fdisk from the shell prompt:

Quote:

# fdisk /dev/sda
When you print the (empty) partition table, you just get configuration information.

Quote:

Command (m for help): p

Disk /dev/sda: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
Now create partition using by pressing n and then selecting the primary or logical partition:

Quote:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-621, default 1):<RETURN>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-621, default 621): +100M

Then press w for writing changes:

Quote:

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@testmachine ~]#
Then type partprobe, this command informs OS or kernel that new partition has been created.

Quote:

[root@testmachine ~]# partprobe
[root@testmachine ~]#
Remember, if you do not give the type of partion then by default linux takes as Linux partition i.e., type 83

After that format the partition:

Quote:

[root@testmachine ~]# mkfs.ext3 /dev/sda6
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
26104 inodes, 104388 blocks
5219 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@testmachine ~]#

then create a directory and mount that partition on that directory:

Quote:

[root@testmachine ~]# mkdir /data
[root@testmachine ~]# mount /dev/sda6 /data
[root@testmachine ~]#

Then make the entry in /etc/fstab in the end to mount it permanently:

Quote:

[root@testmachine ~]# vi /etc/fstab
/dev/sda /data ext3 defaults 0 0


now save the file and quit.

And you have done with your creating a new partition.
:)

fukawi1 01-03-2012 11:26 PM

OP, you need to be clear about what you want to achieve.

Quote:

I want to create New free space partition in ubuntu
Is extremely ambiguous and if you aren't clear on the question you ask, you may get advice that will lead you to results other than what you expected.


All times are GMT -5. The time now is 01:30 PM.