oscargomezf
Posts: 27
Joined: Thu Mar 10, 2016 3:46 pm
Location: Santander, ES

mkcard

Sat Apr 09, 2016 2:13 pm

Hi everyone,

I've always used the a scrip based on mkcard.sh script:

http://downloads.angstrom-distribution. ... mkcard.txt

to build my sdcard because I'm get used to working with buildroot.

https://github.com/oscargomezf/raspberr ... /mkcard.sh

My host platform is Ubunutu 15.10. I've tried to make a new sd card partition and sfdisk has failed, when I tried to execute the script it failed in this part of the code:

Code: Select all

{
	echo ,9,0x0C,*
	echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
The error:

Code: Select all

sfdisk: invalid option -- 'D'

Usage:
 sfdisk [options] <dev> [[-N] <part>]
 sfdisk [options] <command>

Display or manipulate a disk partition table.

Commands:
 -A, --activate <dev> [<part> ...] list or set bootable MBR partitions
 -d, --dump <dev>                  dump partition table (usable for later input)
 -g, --show-geometry [<dev> ...]   list geometry of all or specified devices
 -l, --list [<dev> ...]            list partitions of each device
 -s, --show-size [<dev> ...]       list sizes of all or specified devices
 -T, --list-types                  print the recognized types (see -X)
 -V, --verify                      test whether partitions seem correct

 --part-label <dev> <part> [<str>] print or change partition label
 --part-type <dev> <part> [<type>] print or change partition type
 --part-uuid <dev> <part> [<uuid>] print or change partition uuid
 --part-attrs <dev> <part> [<str>] print or change partition attributes

 <dev>                     device (usually disk) path
 <part>                    partition number
 <type>                    partition type, GUID for GPT, hex for MBR

Options:
 -a, --append              append partitions to existing partition table
 -b, --backup              backup partition table sectors (see -O)
     --bytes               print SIZE in bytes rather than in human readable format
 -f, --force               disable all consistency checking
     --color[=<when>]      colorize output (auto, always or never)
                             colors disabled by default
 -N, --partno <num>        specify partition number
 -n, --no-act              do everything except write to device
     --no-reread           do not check whether the device is in use
 -O, --backup-file <path>  override default backup file name
 -o, --output <list>       output columns
 -q, --quiet               suppress extra info messages
 -X, --label <name>        specify label type (dos, gpt, ...)
 -Y, --label-nested <name> specify nested label type (dos, bsd)

 -L, --Linux               deprecated, only for backward compatibility
 -u, --unit S              deprecated, only sector unit is supported

 -h, --help     display this help and exit
 -v, --version  output version information and exit

Available columns (for -o):
 gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
 dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S
      Start-C/H/S
 bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
 sgi: Device Start End Sectors Cylinders Size Type Id Attrs
 sun: Device Start End Sectors Cylinders Size Type Id Flags

For more details see sfdisk(8).
It seems to be, the option -D (dos compatibility) it' doesn't exist anymore. My current sfdsik version from util-linux is:

$ fdisk -version
fdisk from util-linux 2.26.2

Any suggestions?

Any one knows If tis there a new mkcard.sh script to manage with the new version of fdsik?

Best regards.
Oscar Gomez Fuente

mleiva
Posts: 3
Joined: Sun Apr 09, 2017 11:18 pm

Re: mkcard

Sun Apr 09, 2017 11:29 pm

Hi,


You can remove these lines:

Code: Select all

{
	echo ,9,0x0C,*
	echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE > /dev/null 2>&1
And add these lines:

Code: Select all

sudo sfdisk $DRIVE << EOF
8192,63MiB,0x0C,*
137216,4GiB,,-
EOF
Also you can remove all the code related to CYLINDERS value compute.

Regards.

Return to “Troubleshooting”