fdisk /dev/sda << __EOF__: What does this do?
Code:
fdisk /dev/sda << __EOF__ Code:
root@darkstar:~# fdisk /dev/sda << __EOF__ Kernel 2.6.21.5, Slackware 12.0 |
Hi,
That is a so called HERE-Document construct. All between both __EOF__ is given to fdisk in this case. Have a look here: ABSG - Chapter 19. Here Documents Hope this helps. |
From 'man bash'
Quote:
Too slow! druuna was quicker. |
OK. But then I must take it that n, p, 1, et cetera are commands to fdisk? I do not think so because fdisk only accepts options.
|
Reread the quote from 'man bash'. fdisk is receiving commands from standard input.
Those are commands you can type when you run fdisk. |
Hi,
Quote:
From the top of my head: n - new partition p 1 - primary, partition no 1 64 Mb (size) t e - change partition id to "e" (see list for explanation) p - show partition layout w - write changes and exit. Hope this helps. Too slow! allend was quicker ;) |
According to its manual, fdisk invoked as 'fdisk /dev/sda' is a menu driven program. So I did:
Code:
root@darkstar:~# fdisk /dev/sda |
Hi,
A here-document is mostly used to automate commands you do often by hand. It does assume that you do know the particulars. If this is the first time you use fdisk I would advise you not to use a here document but get familiar with fdisk first. BTW the p used in your here-document is _not_ the p print the partition table option. It is part of the n add a new partition option. After using n more questions are asked (the p and 1 being answers to those questions). Have a look here: Linux Partition HOWTO - 5. Partitioning with fdisk Hope this helps. |
Here is a more complete part of the story:
Code:
First blank the MMC card's partition table with parted: (/dev/sdX as an example) Quote:
t e - change partition id to "e" Could you druuna, or someone else, expand a little? The partition id... isn't it, for instance, 0x83 for ext2/ext3, or 0x82 for a linux swap? But what can "e" possibly be? |
Hi,
The e when using fdisk's t option sets the W95 FAT16 (LBA) system ID. Have a look at the bold parts: Code:
$ fdisk /dev/sdb Hope this helps. |
Druuna: you may be wondering what am I aiming at. Briefly stated: I have a very little board called Beagleboard xM, build around an ARM processor, launched on the market by Texas Instruments. A friend of mine asked me to load Linux onto it (Linux embedded), unfortunately of the variety called Ubuntu. OK. To do the job, I decided to follow the instructions contained in this document, 6 Method 3: Manual Install (no automatic scripts).
Following the procedure, I did Code:
parted -s /dev/sda mklabel msdos Well, to see what I had done, I used cfdisk to inspect the SD card, and every thing seems alright. The t e command: I did not realize 'e' is just 0x0e! In the process, I learned what a here-document is and tried my hand with fdisk. No questions, then, in this post except for this: what could the procedure author mean by Quote:
|
Hi,
Quote:
Most linux distro's use the util-linux package. On my Debian box: Code:
$ /sbin/fdisk -v |
On my box I only get
Code:
Code:
root@darkstar:~# grep -irl fdisk /var/log/packages/ |
You're welcome :)
|
All times are GMT -5. The time now is 09:07 PM. |