# mkudffs

## NAME



           mkudffs — create a UDF filesystem
    


## SYNOPSIS



           **mkudffs [ options ]**_device_ **[**_blocks-count_ **]**
    


## DESCRIPTION



           **mkudffs** is used to create a UDF filesystem on a device (usually a
           disk). _device_ is the special file corresponding to the device
           (e.g. _/dev/hdX_) or file image. _blocks-count_ is the number of
           blocks on the device. If omitted, **mkudffs** automagically figures
           the filesystem size. The order of options matters. Encoding option
           must be first and options to override default settings implied by
           the media type or UDF revision should be after the option they are
           overriding.
    


## OPTIONS



           **-h,--help**
                  Display the usage and list of options.
    
           **-l,--label=**_label_
                  Specify the UDF label. UDF label is synonym for specifying
                  both **--lvid** and **--vid** options. If omitted, **mkudffs** label is
                  _LinuxUDF_. (Option available since mkudffs 1.1)
    
           **-u,--uuid=**_uuid_
                  Specify the UDF uuid. It must be exactly 16 hexadecimal
                  lowercase digits and is used for first 16 characters of
                  **--fullvsid** option. If omitted, **mkudffs** uuid is generated
                  from local time and a random number. (Option available
                  since mkudffs 1.1)
    
           **-b,--blocksize=**_block-size_
                  Specify the size of blocks in bytes. Valid block size for a
                  UDF filesystem is power of two in range from _512_ to _32768_
                  and must match a device logical (sector) size. If omitted,
                  **mkudffs** block size is set to device logical block (sector)
                  size. If logical block (sector) size is unknown (e.g. when
                  creating disk image) then for **--media-type** =_hd_ is used block
                  size _512_ and for other media types _2048_. (Prior to mkudffs
                  1.1 default value was always 2048 independently of
                  **--media-type**)
    
           **-m,--media-type=**_media-type_
                  Specify the media type. Must be specified before **--udfrev**.
                  Default value is autodetected. When autodetection does not
                  work (e.g. when creating disk image) then _hd_ value is
                  assumed. Valid media types are:
    
                       _hd_     HD (Hard Disk)
    
                       _worm_   WORM (Write Once Read Many)
    
                       _mo_     MO (Magneto Optical)
    
                       _cd_     CD-ROM (CD Read-Only Memory)
    
                       _cdr_    CD-R (CD Recordable)
    
                       _cdrw_   CD-RW (CD Read-Write)
    
                       _dvd_    DVD-ROM (DVD Read-Only Memory)
    
                       _dvdr_   DVD-R (DVD Recordable)
    
                       _dvdrw_  DVD-RW (DVD Read-Write)
    
                       _dvdram_ DVD-RAM (DVD Random Access Memory)
    
                       _bdr_    BD-R (Blu-ray Disc Recordable)
    
                  (Short option variant **-m** and values _cd_ , _dvdr_ , _bdr_ are
                  available since mkudffs 2.0 and autodetection is supported
                  since mkudffs 2.2)
    
           **-r,--udfrev=**_udf-revision_
                  Specify the UDF revision to use, either in hexadecimal BCD
                  (e.g. _0x0201_) or decimal (e.g. _2.01_) format. Valid
                  revisions are _1.01_ , _1.02_ , _1.50_ , _2.00_ , _2.01_ , _2.50_ and _2.60_.
                  If omitted, **mkudffs** UDF revision is _2.01_ , except for Blu-
                  ray Discs which is _2.50_. UDF revisions higher then _2.01_ are
                  experimental. Option must be specified after **--media-type**.
                  (Values in decimal format and UDF revisions higher then
                  _2.01_ are supported since mkudffs 2.0, UDF revision 1.01 is
                  supported since mkudffs 2.1)
    
           **-n,--no-write**
                  Not really, do not write to _device_. Just simulate and
                  display what would happen with _device_. Useful for
                  determining the calculated location of different UDF
                  blocks. (Option available since mkudffs 2.0)
    
           **--new-file**
                  Create a new image file specified by _device_ with
                  _blocks-count_ and fail if file already exists. If omitted,
                  **mkudffs** creates a new image file only in case it does not
                  exist yet. (Option available since mkudffs 2.0)
    
           **--lvid=**_logical-volume-identifier_
                  Specify the _Logical Volume Identifier_. If omitted, **mkudffs**
                  Logical Volume Identifier is _LinuxUDF_. Most UDF
                  implementations use this identifier as a disk label.
    
           **--vid=**_volume-identifier_
                  Specify the _Volume Identifier_. If omitted, **mkudffs** Volume
                  Identifier is _LinuxUDF_.
    
           **--vsid=**_volume-set-identifier_
                  Specify the 17.–127. character of _Volume Set Identifier_. If
                  omitted, **mkudffs** Volume Set Identifier is _LinuxUDF_.
    
           **--fsid=**_file-set-identifier_
                  Specify the _File Set Identifier_. If omitted, **mkudffs** File
                  Set Identifier is _LinuxUDF_.
    
           **--fullvsid=**_full-volume-set-identifier_
                  Specify the full _Volume Set Identifier_. Overwrite previous
                  **--uuid** and **--vsid** options. (Option available since mkudffs
                  1.1)
    
           **--owner=**_owner-name_
                  Specify the Owner name, person creating the medium or
                  filesystem. It is stored in UDF Logical Volume Info1, part
                  of UDF Implementation Use Volume Descriptor. (Option
                  available since mkudffs 2.3)
    
           **--organization=**_organization-name_
                  Specify the Organization name responsible for creating the
                  medium or filesystem. It is stored in UDF Logical Volume
                  Info2, part of UDF Implementation Use Volume Descriptor.
                  (Option available since mkudffs 2.3)
    
           **--contact=**_contact-information_
                  Specify the Contact information for the medium or
                  filesystem. It is stored in UDF Logical Volume Info3, part
                  of UDF Implementation Use Volume Descriptor. (Option
                  available since mkudffs 2.3)
    
           **--uid=**_uid_
                  Specify the uid of the root (/) directory. If omitted,
                  **mkudffs** uid is _0_. Special value _-1_ means invalid or not
                  specified uid. (Option available since mkudffs 1.1)
    
           **--gid=**_gid_
                  Specify the gid of the root (/) directory. If omitted,
                  **mkudffs** gid is _0_. Special value _-1_ means invalid or not
                  specified gid. (Option available since mkudffs 1.1)
    
           **--mode=**_mode_
                  Specify permissions in octal mode bits of the root (/)
                  directory. If omitted, **mkudffs** mode is _0755_. (Option
                  available since mkudffs 2.0)
    
           **--read-only**
                  This option specify that the whole UDF disk should be
                  treated as read-only. It sets _SoftWriteProtect_ domain flag
                  in _Logical Volume Descriptor_ and in _File Set Descriptor_.
                  Plus for overwritable media types (_hd_ , _dvdram_ , _dvdrw_) set
                  _UDF Access Type_ to read-only. (Option available since
                  mkudffs 2.2)
    
           **--bootarea=**_fill_
                  Specify how to fill UDF boot area which is the first 32kB
                  of the disk and is not used by UDF itself. Option _mbr_ make
                  sense only when running **mkudffs** on whole disk, not on just
                  one partition. Valid options are:
    
                       _preserve_
                              preserve existing UDF boot area, do not touch
                              it (default for media type different from _hd_)
    
                       _erase_  erase existing UDF boot area, fill it by zeros
                              (default for _hd_ media type on partitions and on
                              removable disks)
    
                       _mbr_    put MBR table with one partition which starts
                              at sector 0 (includes MBR itself) and spans
                              whole disk device, needed only for non-
                              removable hard disks used on Microsoft Windows
                              systems (default for _hd_ media type on non-
                              removable hard disk without partitions), see
                              section **WHOLE DISK VS PARTITION**
    
                       _mbr:_**sec-size**
                              same as _mbr_ but explicitly set MBR sector size
                              to _sec-size_ value, default _sec-size_ is device
                              logical block (sector) size with fallback to
                              size _512_ bytes
    
                  (Option available since mkudffs 2.0)
    
           **--strategy=**_strategy_
                  Specify the allocation strategy to use. Valid strategies
                  are _4_ and _4096_. If omitted, **mkudffs** strategy is based on
                  the **--media-type**.
    
           **--spartable, --spartable=**_spartable-number_
                  Enable usage Sparing Table. Optionally specify also the
                  number of sparing tables. Valid numbers are _1–4_. When the
                  spartable number is omitted then two tables are written to
                  the disc. If the option is omitted then usage of Sparing
                  Table depends on the media type. (Option prior to mkudffs
                  2.0 was available only for _cdrw_ media type)
    
           **--sparspace=**_num-of-entires_
                  Specify the number of entries in Sparing Table. If omitted,
                  the default number of entries is _1024_ , but depends on the
                  media type. (Option available since mkudffs 2.0)
    
           **--packetlen=**_length_
                  Packet length in a number of blocks used for alignment. All
                  continuous UDF structures would be aligned to packets. It
                  specifies also the size of the Sparing Space and packet
                  length in Sparing Table. It should match the device
                  ECC/packet length. If omitted, default value for DVD discs
                  is _16_ blocks, for CD/BD discs it is _32_ blocks and otherwise
                  _1_ block. (Option prior to mkudffs 2.1 was available only
                  for _cdrw_ and _dvdrw_ media types)
    
           **--vat** Enable usage of Virtual Allocation Table (VAT). If omitted,
                  usage depends on the media type. (Option available since
                  mkudffs 2.0)
    
           **--startblock=**_start-block_
                  Specify the block location where the UDF filesystem starts.
    
                  Normally start block is _0_ , but when creating second or
                  higher session for Multisession UDF optical disc it is the
                  block location where that new session starts.
    
                  When updating existing Multisession UDF image file, **mkudffs**
                  overwrites only data blocks for a new session at start
                  block position in the image file.
    
                  When creating a new UDF image file, **mkudffs** stores only
                  data blocks for a new session at beginning of the image
                  file. Therefore data for start block would be written to
                  the zero block instead of the start block. Such image
                  without leading blocks (where are located previous
                  sessions) is suitable for burning a new session to the
                  optical disc. But it cannot be read or detected by any UDF
                  tool until leading zero blocks (or previous sessions) are
                  prepended to the image file.
    
                  For calculating position where a new session of particular
                  optical disc should start is required to use software which
                  would be used for burning newly created image. So for
                  example, if for burning is used **wodim**(1) then second value
                  on output from **wodim -msinfo** call is start block.
                  Accordingly for **cdrecord**(1) call **cdrecord -msinfo** or for
                  **cdrdao**(1) call **cdrdao msinfo** or for **xorriso**(1) call **xorriso**
                  **-as cdrecord dev=/dev/cdrw -msinfo**.
    
                  (Option available since mkudffs 2.3)
    
           **--minblocks=**_min-num-of-blocks_
                  Specify minimal number of blocks to write on disc with
                  Virtual Allocation Table.
    
                  This option affects block position where is written Virtual
                  Allocation Table.  And in case option **--closed** is used then
                  also it affects block position of the second Anchor Volume
                  Descriptor Pointer.
    
                  Default value for _cdr_ media type is 300. This is safe
                  default to allow burning CD-R disc image in Track-at-Once
                  mode. This mode requires to burn image with minimal size of
                  300 sectors. Burning CD-R discs in other modes (e.g. Disc-
                  at-Once or Packet-Writing) may allow to allow to use also
                  smaller disc images.
    
                  For all other media types there is no default minimal
                  limit.
    
                  (Option available since mkudffs 2.3)
    
           **--closed**
                  Close disc with Virtual Allocation Table. AVDP is written
                  also to the end of the disc. By default, the disc with
                  Virtual Allocation Table is not closed.
    
           **--space=**_space_
                  Specify the Space Set. _Unallocated_ Space Set is used for
                  media which blocks may be allocated immediately. _Freed_
                  Space Set is used for media which blocks needs to be
                  specially prepared/erased before allocation. In Space _Table_
                  is stored list of unallocated extents. In Space _Bitmap_ is
                  stored bitmap of unallocated blocks. Not used for VAT.
    
                       _freedbitmap_
                              Freed Bitmap
    
                       _freedtable_
                              Freed Table
    
                       _unallocbitmap_
                              Unallocated Bitmap (default)
    
                       _unalloctable_
                              Unallocated Table
    
           **--ad=**_ad_
                  Specify the Allocation Descriptors of the root (/)
                  directory.
    
                       _inicb_  Allocation Descriptors in ICB (default)
    
                       _short_  Short Allocation Descriptors
    
                       _long_   Long Allocation Descriptors
    
           **--noefe**
                  Don't Use Extended File Entries for the root (/) directory.
                  Affects only UDF 2.00 or higher. Must be specified after
                  **--udfrev**.
    
           **--locale**
                  Treat identifier string options as strings encoded
                  according to the current locale settings (default). Must be
                  specified as the first argument. (Option available since
                  mkudffs 2.0)
    
           **--u8** Treat identifier string options as strings encoded in 8-bit
                  OSTA Compressed Unicode format without leading Compression
                  ID byte, which is equivalent to Latin1 (ISO-8859-1). Must
                  be specified as first argument.
    
           **--u16** Treat identifier string options as strings encoded in
                  16-bit OSTA Compressed Unicode format without leading
                  Compression ID byte, which is equivalent to UTF-16BE. Note
                  that it is not possible to include zero byte in command
                  line options, therefore any character which has at least
                  one zero byte cannot be supplied (this applies to all
                  Latin1 characters). Must be specified as the first
                  argument.
    
           **--utf8** Treat identifier string options as strings encoded in
                  UTF-8. Must be specified as the first argument. (Prior to
                  mkudffs 2.0 this was default option)
    


## COMPATIBILITY



       **OPERATING SYSTEMS SUPPORT**
           UDF filesystem is natively supported by large amount of operating
           systems. See following compatibility table:
    
           ┌─────────────────────────────┬──────────────────────────┐
           │      Operating system       │ Maximum UDF revision for │
           ├──────────┬──────────────────┼────────────┬─────────────┤
           │   Name   │     Version      │    read    │    write    │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │          │ 2.3.17 – 2.4.5   │    2.00    │    2.00     │
           │ Linux    │ 2.4.6 – 2.6.25   │    2.01    │    2.01     │
           │          │ 2.6.26 (and new) │    2.50    │    2.01     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │          │ 98/Me            │    1.02    │    none     │
           │ Windows  │ 2000             │    1.50    │    none     │
           │          │ XP               │    2.01    │    none     │
           │          │ Vista (and new)  │    2.60    │    2.50     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │ Mac OS   │ 8.1 – 8.5        │    1.02    │    none     │
           │          │ 8.6 – 9.2        │    1.50    │    1.50     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │          │ 10.0 – 10.3      │    1.50    │    1.50     │
           │ Mac OS X │ 10.4             │    2.01    │    2.01     │
           │          │ 10.5 (and new)   │    2.60    │    2.50     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │ FreeBSD  │ 5 (and new)      │    1.50    │    none     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │ NetBSD   │ 4.0              │    2.60    │    none     │
           │          │ 5.0 (and new)    │    2.60    │    2.60     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │          │ 3.8 – 3.9        │    1.02    │             │
           │ OpenBSD  │ 4.0 – 4.6        │    1.50    │    none     │
           │          │ 4.7 (and new)    │    2.60    │             │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │ Solaris  │ 7 (and new)      │    1.50    │    1.50     │
           ├──────────┼──────────────────┼────────────┼─────────────┤
           │ AIX      │ 5.2 (and new)    │    2.01    │    2.01     │
           └──────────┴──────────────────┴────────────┴─────────────┘
    
           Note that Windows 98 and Windows Me can read UDF filesystem only
           from CD and DVD optical discs, not from hard disks.
    
       **BLOCK SIZE**
           In most cases, operating systems are unable to mount UDF
           filesystem if UDF block size differs from logical sector size of
           the device. Typically hard disks have sector size 512 bytes and
           optical media 2048 bytes. Therefore UDF block size must match the
           logical sector size of the device.
    
           Linux kernel prior to version 2.6.30 used hardcoded UDF block size
           of 2048 bytes independently of logical sector size, therefore it
           was not able to automatically mount UDF filesystem if block size
           differed from 2048. Since 2.6.30 and prior to 4.11 Linux kernel
           used a logical sector size of the device as UDF block size, plus
           it tried fallback to 2048. Since 4.11 it uses logical sector size
           and fallbacks to any valid block size between logical sector size
           and 4096. Therefore since version 2.6.30 Linux kernel can
           automatically mount UDF filesystems correctly if UDF block size
           matches device logical sector size and since version 4.11 can
           automatically also mount devices which sector size does not match
           UDF block size. In any case and also for Linux kernel prior to
           version 2.6.30, different UDF block size (which is not
           autodetected) can be manually specified via **bs** =_blocksize_ mount
           parameter.
    
       **WHOLE DISK VS PARTITION**
           UDF filesystem is supposed to be formatted on the whole media and
           not to the partitioned hard disk. Mac OS X systems enforce this
           rule and reject to automatically mount UDF filesystem unless it is
           formatted on the whole unpartitioned hard disk. Possible partition
           table (e.g. MBR or GPT) on disk with valid UDF filesystem is
           ignored. On the other hand, Microsoft Windows systems are unable
           to detect non-removable hard disks without MBR or GPT partition
           table. Removable disks do not have this restriction. A consequence
           is that non-removable hard disks formatted to UDF by Windows
           Vista+ are not recognized by Mac OS X systems and vice-versa. Note
           that manual mount of UDF partition on partitioned hard disk on Mac
           OS X system is possible and working (e.g. by running commands:
           mkdir /Volumes/DriveName && mount_udf /dev/disk1s1
           /Volumes/DriveName). But there is no known way to mount an
           unpartitioned non-removable disk on Windows system.
    
           Thanks to reserved and unused UDF boot area (first 32kB of UDF
           filesystem) it is possible to deal with this problem, by putting
           MBR on such non-removable hard disk just for compatibility reasons
           with Windows. Such MBR table would contain one partition which
           starts at sector 0 (includes MBR itself) and spans whole disk
           device. So the whole disk device and also the first partition on
           disk points to same sectors. Therefore UDF filesystem can be
           mounted either from whole disk device (needed for Mac OS X
           systems) or from first partition (needed for Microsoft Windows
           systems).
    
           Linux kernel ignores MBR table if contains partition which starts
           at sector 0. Normally Linux kernel can detect and mount UDF
           filesystem either on a partition or on whole disk device. It does
           not have any restrictions.
    
           **mkudffs** option **--bootarea** =_mbr_ put such MBR table for compatibility
           with Microsoft Windows systems into disk when formatting.
    
       **LINUX LABEL BUGS**
           In most cases _Logical Volume Identifier_ is used as UDF label. But
           Linux libblkid prior to version 2.26 used _Volume Identifier_.
           Therefore **mkudffs --label** for compatibility reasons set both
           _Logical Volume Identifier_ and _Volume Identifier_.
    
           Linux libblkid prior to version 2.30 incorrectly processed non-
           ASCII identifier strings encoded in 8-bit OSTA Compressed Unicode
           format. Therefore **mkudffs** since version 2.0 for compatibility
           reasons tries to encode a non-ASCII identifier strings in 16-bit
           OSTA Compressed Unicode format and then fallbacks to 8-bit format.
    
           For more information about UDF Label and UUID see udflabel(8)
           section **UDF LABEL AND UUID**.
    


## EXIT STATUS



           **mkudffs** returns 0 if successful, non-zero if there are problems.
    


## LIMITATIONS



           **mkudffs** cannot create UDF 2.50 Metadata partition, therefore it
           does not support UDF revisions higher than 2.01 for non Write Once
           media yet. So there is no support for Blu-ray discs which needs
           UDF 2.50 (except for Blu-ray Disc Recordable which does not
           require Metadata partition).
    
           **mkudffs** prior to version 2.2 was unable to process Unicode strings
           with code points above U+FFFF. When option **--utf8** was specified
           then input strings were limited to 3-byte UTF-8 sequences and when
           option **--u16** was specified then input strings were limited just to
           UCS-2BE strings (subset of UTF-16BE).
    


## BUGS



           **mkudffs** prior to version 1.1 was unable to process non-ASCII
           characters from identifier strings in **--utf8** mode, **--vsid** option
           was completely broken and **--blocksize** must have been manually
           specified for hard disks as default value was hardcoded for
           optical disks. **mkudffs** prior to version 2.0 generated broken and
           unreadable _cdr_ disc images.
    


## AVAILABILITY



           **mkudffs** is part of the udftools package and is available from
           https://github.com/pali/udftools/.
    


* * *