[Solved] Creating unformatted partition


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users [Solved] Creating unformatted partition
# 1  
Old 10-30-2011
[Solved] Creating unformatted partition

I needed to create a un-formatted partition of X MB on a disk dont want it from GUI but from command line not sure what should be specified for fdisk
# 2  
Old 10-30-2011
Please provide OS information first. Commands and options for fdisk utility varies from OS to OS. Here's what I would do on a RHEL system to create 30MB partition! Smilie

Code:
[root@testserv-sl6 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 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: 0x00092e03

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         244     1953125   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2             244         487     1952768   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sdb3             487         730     1952768   83  Linux
Partition 3 does not end on cylinder boundary.
/dev/sdb4             730        1045     2529280   83  Linux

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Selected partition 4

Command (m for help): p

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 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: 0x00092e03

   Device Boot      Start         End      Blocks   Id  System

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

Command (m for help): p

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 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: 0x00092e03

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           5       40131    5  Primary

Command (m for help): w

# 3  
Old 11-03-2011
Ok i forgot that fdisk only creates the partition as un-formatted then you have to use mke2fs to create partition.

In anyways can this automated I mean can all these options be specified via script i'm asking since its a interactive process.Would like to avoid expect script here.
# 4  
Old 11-03-2011
parted has a command line mode that can be scripted.
# 5  
Old 11-04-2011
Thanks parted just meets my requirements
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tranforming unformatted text to 1-column with awk

Hello, I have an input that is unformatted text, such as below. INPUT: Hola. Me llamo Davíd y soy de Andalucía. Mi color favorito es rojo. ¿Como te llamas? ¿Cuál es tu color favorito? I want to take each word and punctuation and place it on its own line, with a space in between each individual... (1 Reply)
Discussion started by: owwow14
1 Replies

2. Solaris

Trouble creating a disk partition slice (EFI)

Hi all, I am using SPARC Solaris 11.1 with EFI labelled disks. I am new to ZFS file systems and slightly stuck when trying to create a partition (slice) on one of my LUNs. EFI labels use sectors and blocks and I am not sure how exactly it works. From here I can try and create a... (2 Replies)
Discussion started by: selectstar
2 Replies

3. Linux

Creating /boot partition for LVM VG

Hi, I have a server booted into sysresccd (mini-linux OS) with 1 40 GB disk attached I am trying to create a volume group and restore another server into the new one However, when I try to create a partition for /boot it seems that my VG in LVM is not recognized anymore These are the... (2 Replies)
Discussion started by: galuzan
2 Replies

4. OS X (Apple)

Creating a hidden partition that doesn't mount automatically

I have a drive full of diagnostic images (ASD), and I also use it for storage, installers, etc. When I plug it in to a booted system, it has to mount every single volume (about 25) which can take some time. I would like to keep all the ASD partitions from mounting when plugged in/at boot. I know... (0 Replies)
Discussion started by: nextyoyoma
0 Replies

5. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

6. Windows & DOS: Issues & Discussions

[SOLVED] Creating .tar file

Hi, How to create a .tar file in windows OS.. I need to ftp tat <filename>.tar file into AIX and untar it there and will use for futher actions.. Please help.. Thanks in advance.. (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

7. HP-UX

[Solved] Problem creating print queue HP-UX -to- HP4100N

Hi all, I am new to HP-UX, using SAM I cannot make a print queue on my test server. From my test & live server as the user required and as root I can ping my printer. I have tried to clone the test print queue using the exact same options use on my live system that prints just fine. Can anyone... (9 Replies)
Discussion started by: KmJohnson
9 Replies

8. Filesystems, Disks and Memory

Creating /boot partition & MBR concerns

I have 40GB HD with mepis8, swap, MBR and under flags word boot. I also have a 160 GB external with a few Linux OS, no swaps, no extended etc. I am total Linux no MS I would feel more secure by resizing that sda1 partition and creating a /boot partition with the MBR housed there. Is that a... (1 Reply)
Discussion started by: worthamtx
1 Replies

9. Solaris

Creating a partition....???

I have created a pool named earthpool using zpool command. Later I created a file system named earth using zfs command. I changed the mountpoint of earth (file system) using zfs set mountpoint=/earth earthpool/earth. Where /earth is a directory created in root using mkdir. Now, I have a... (8 Replies)
Discussion started by: bharu_sri
8 Replies

10. UNIX for Dummies Questions & Answers

Error in creating logical partition

Dear Members, I am using SCO-Unix 5.0.5. I have created 2 logical drives but some of the blocks are overlapped and are now giving warning during startup. I have used fsck to settle the problems but to no avail. Kindly help me to sort out the problem. Thanks (3 Replies)
Discussion started by: nagendrajaiswal
3 Replies
Login or Register to Ask a Question