-   Linux - Hardware (
-   -   Makeing a Partition (

cthomas 02-02-2007 09:10 PM

Makeing a Partition
I'm running Novell SUSE Enterprise Server 10.0. And I have a sata drive and when I do sfdisk -l /dev/sda1 (that is how it is listed in/dev)it returns "Warning: start=63 - this looks lake a partition rather than the entire disk. Use the -- force option if you really want this." [u]This is an entire disk[./U] I have looked at a lot of examples and they all show this sfdisk /dev/hdc << EOF
Which I don't understand. All I want is to make the whole drive one partition. I tried <start> <size> <id>; sfdisk /dev/sda1 0 298 L but it doesn't work. What do I need to ty sad.gif pe?

The command

sfdisk /dev/hdc << EOF

Do you type this in just as it is showed here? I couldn't find out what this means "<< EOF" When you enter this sfdisk /dev/hdc. It seems like you are in the program. How can you exit it with out changing any thing?

tbutttbutt 02-02-2007 09:44 PM

/dev/sda1 is a partition, not the entire disk which would be /dev/sda.

/dev/sda1 along with the size of the partition equal to the entire disk should be fine.

<< LABEL ...

is a 'here document'. Everything between the two labels will act as an argument to sfdisk. You should be able to exit with a 'q' or something.

gilead 02-02-2007 09:55 PM

I don't know what the values given in that example will do to your hard disk, but if you know that the values are correct for your disk then type them exactly. Once you type the EOF at the end, the changes are saved to disk and the partition tables is altered. I'd expect that <Ctrl>-c will get you out without saving the changes though, it works for that syntax with other commands.

That syntax is called a here document. If you type man bash and search for it you'll get an overview. Simply put, the shell will pass everything between the 2 EOF statements as input to the supplied command - in this case sfdisk.

If you're only trying to create a single partition that takes up the whole disk, it might be easier to do it manually with fdisk. Using sfdisk as your example shows is most useful when embedding commands in scripts.

syg00 02-02-2007 10:09 PM

Agree - sfdisk has it's uses (*mighty* good ones), but this may not be one for a presumably new user.
That looks like something from the man page. This might work for you

sfdisk /dev/sda << EOF

Personally I think you should consider cfdisk - it's "graphical" (in a sense :)), and you see what you are doing. Use the up/down arrow keys to highlight the free space, then left/right arrows to select the commands along the bottom. "new" to create a (primary) partition - just take all the defaults for size, start.
"write" to update the partition table, and "quit" to get out.

cthomas 02-03-2007 12:19 AM

:) Ok. So if I type:
sfdisk /dev/hda << EOF hit the enter key
on the next line type: ; hit the enter key
on the next line type: EOF hit the enter key

I will have One big partition: of 300GB, the size of this hard drive.

There is nothing on this disk to backup.

All times are GMT -5. The time now is 10:32 PM.