I'm trying to create a UDF partition on a flash drive to install grub2 (to boot ISOs from)

~$ export DSK=/dev/sdd
# wipe the disk
~$ sudo dd if=/dev/zero of=${DSK} bs=512 count=2048
~$ sudo sgdisk --zap-all ${DSK}

# create partition for udf
~$ #sudo parted -s ${DSK} mklable msdos
~$ #sudo parted -s ${DSK} -a optimal unit MB -- mkpart primary 1 -1
~$ (echo o; echo n; echo p; echo 1; echo ; echo ; echo t ; echo 6 ; echo w) | sudo fdisk -b 512 ${DSK}

~$ sudo mkudffs --media-type=hd --blocksize=512 ${DSK}1
trying to change type of multiple extents
  • Just as a side note, depending on the flash drive (SD cards), it is unwise to use anything but FAT (or exFAT). Using something else on SDXC makes them a lot slower, and throws off wear leveling considerably. It is also against spec. If you need a boot loader on there, I suggest SYSLINUX.
    – polemon
    Aug 24 '14 at 21:05

I had the same error with mkudffs on a partition, but on the device itself it worked flawlessly. Running strace on mkudffs showed that it was seeking to a few places and trying to read 1 byte, but getting nothing back. dvd+rw-format flat out refused to work on partitions.

What worked for me was to create a UDF filesystem essentially anywhere, in this case the USB stick without a partition, /dev/sdd

mkudffs --media-type=hd --vid=VOLUME --lvid=VOLUME --blocksize=512 /dev/sdd

save at least the beginning of that filesystem somewhere:

dd if=/dev/sdd bs=1024 count=40000 | gzip > /tmp/udf

create the partition (of type 6):

fdisk  /dev/sdd

plaster the partial, non-fitting filesystem on the partition:

gunzip -c  /tmp/udf  | dd of=/dev/sdd1

then make a proper filesystem:

mkudffs --media-type=hd --vid=UDF32GB --lvid=UDF32GB --blocksize=512 /dev/sdd1

trying to change type of multiple extents

This problem should be fixed in the last mkudffs 2.0 version from udftools project.

Make sure that partition which is going to be formatted as UDF has at least 300 sectors. Partitions/disks with less sectors cause problems for UDF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.