Amir Tahvildaran on 9 Jan 2013 15:52:59 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Partitioning an SD Card

Did you create a partition table on a partition by accident?

sdb vs sdb1?


On Wed, Jan 9, 2013 at 5:15 PM, Eric H. Johnson <> wrote:
Hi all,

I have just started playing with a device similar to a Raspberry Pi or
Beaglebone called an Olinuxino. More information can be found here:

While waiting for my hardware to arrive I decided to take a shot at rolling
my own kernel since I will need to modify it shortly to add real-time
support (xenomai). I was able to successfully make uboot and the kernel and
am now ready to write it to an SD card, which is where I am encountering a
problem. The complete instructions are here:

These instructions are for Ubuntu, although no version is specified. I am
running Ubuntu 12.04.

I am at the section "Format and Setup the SD card":

The abbreviated commands are:

# ls /dev/sd
# fdisk -u=sectors /dev/sdb1

Within fdisk:

1. p           <list partitions>
2. d 1       <if any partitions exist>
3. n p 1   <create first partition as primary, ordinal 1, sectors
5. n p 2   <Create second partition primary, ordinal 2, sectors 34916 to all
6. p
7. w

Exit fdisk

# mkfs.vfat /dev/sdb1
# mkfs.ext3 /dev/sdb2

The first problem was with the command ls/dev/sd, I assume it should be ls
/dev/sd*. Suffice it to say, when I insert the SD card, sdb and sdb1 appear.
My machine also automatically mounts the SD card, so I unmounted it to run

FDisk runs fine up to the write, where I get "Re-reading the partition table
failed with error 22: invalid argument. The kernel still uses the old table.
The new table will be used at the next reboot or after you run partprobe(8)
or kpartx(8). I run partprobe which just drops back to the command prompt
with no errors. If I go back into fdisk, my partitions are still there.
Note, they are names sdb1p1 and sdb1p2.

Running mkfs.vfat /dev/sdb1 appears to run successfully.

Running mkfs.ext3 /dev/sdb2 gives and error "No such file or directory".
This agrees with an ls of /dev, only sdb1 is listed. I also tried sdb1p1 and
sdb1p2, but get the same no such file error. Also, after doing this if I go
back into fdisk and list the partitions, no partitions are listed any more.

Any idea what I am doing wrong?

BTW, for anyone interested, I have just stared a blog to document my
progress on this here:


Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --