Monday, April 14, 2014

Burn DVD from an iso image

You have backed up a DVD to your hard drive in ISO format. Now, you want to burn a DVD from that image. This post illustrates how, first using the command line, then the GUI.

Command Line

Insert the DVD disc, and issue one of the following commands to burn a disc.

  1. growisofs

    To install growisofs,

    $ sudo apt-get update
    $ sudo apt-get install growisofs  

    To burn DVD,

    $ growisofs  -dvd-compat -Z  /dev/dvd=/home/peter/my.iso 
  2. wodim

    To install wodim,

    $ sudo apt-get update
    $ sudo apt-get install wodim

    Burn a disc like this:

    $ sudo wodim -v dev=/dev/dvd speed=4 -dao  -eject -data /home/peter/my.iso 


The GUI favorites are:

Below are the K3b-specific instructions to burn an ISO image on a DVD.

  1. Run K3b.
  2. Select Burn Image in the Tools menu.
  3. Specify the location of the ISO image file.
  4. Insert a blank DVD disc.

    The Burn Medium field is updated to indicate the detected empty disc.

  5. Click Start.

Thursday, April 10, 2014

Backup DVDs using K3b

My previous post explains how to backup and playback a DVD from an iso image file in the hard way - using the command line. Now, I discuss how to do it with K3b, a GUI tool.

K3b is a tool from the KDE desktop environment. For Debian users, install it as follows:

$ sudo apt-get install k3b


  1. Run K3b.
  2. Click the Copy Medium button, or select Copy Medium in the Tools menu.
  3. Insert your disc into the DVD drive.

    Note that the Source Medium is updated to show the DVD title.

  4. Select Only create image option.

    By default, K3b writes the iso image to disk, copies it to a DVD, and then removes the image on the hard disk. We assume that you only want to backup to the hard disk.

  5. Specify the folder to store iso image.

    Click the Image tab, and select a folder to hold the backup image.

  6. Click Start button.

Mount iso image

Before you can playback from the iso image, you must first mount it. There are GUI tools to mount iso image files. For Debian wheezy, install Furious ISO mount as follows. (For Ubuntu, install gmountiso.)

$ sudo apt-get install furiusisomount

To mount an iso image,

  1. Run Furious ISO mount.
  2. Click Browse to locate the iso image file.
  3. Select Loop.
  4. Click Mount.
  5. Enter the root password to grant permission to mount the iso.

Note the mount point. You need to know the mount point later when you play back the video. By default, the mount point is a sub-directory under your home directory, and is named after the iso image file - /home/peter/NTSurveyDVD5_iso.

Currently, you cannot change the mount point through the GUI. To change it, you need to edit the configuration file ~/.furiusisomount/settings.cfg.

mount_point: /home/peter


There is no shortage of GUI video players. My favorite is VideoLAN, aka vlc.

  1. Run vlc.
  2. Select Open Disc in the Media menu.
  3. To specify the disc device, click Browse to navigate to the mount point.
  4. Click Play.

Sunday, April 6, 2014

Backup and playback DVD from hard drive using command line

This post is about how to backup and playback DVD content on a hard drive using the command line.

  1. Check available space on hard drive.
    $ df -h
    Filesystem               Size  Used Avail Use% Mounted on
    rootfs                   1.4T   41G  1.2T   4% /
    udev                      10M     0   10M   0% /dev
    tmpfs                    1.6G  900K  1.6G   1% /run
    /dev/disk/by-uuid/6c30b  1.4T   41G  1.2T   4% /
    tmpfs                    5.0M     0  5.0M   0% /run/lock
    tmpfs                    9.6G  640K  9.6G   1% /run/shm

    The df command indicates that 1.2 TB is available on my hard drive, which is plenty to hold the 4 GB DVD.

  2. Insert disc into DVD drive.
  3. Backup DVD.

    Both the dd and readom commands write to a single iso file. The dvdbackup command writes out the DVD file structure - the complete VIDEO_TS folder.

    • dd
      $ dd if=/dev/dvd of=~/birthday.iso
      8310528+0 records in
      8310528+0 records out
      4254990336 bytes (4.3 GB) copied, 303.204 s, 14.0 MB/s
    • readom

      According to its man page, "unless you want to risk getting problems, readom should be run as root." Hence, sudo below.

      $ sudo readom dev=/dev/dvd f= ~/birthday.iso 
      Read  speed:  5540 kB/s (CD  31x, DVD  4x).
      Write speed: 22160 kB/s (CD 125x, DVD 16x).
      Capacity: 2077632 Blocks = 4155264 kBytes = 4057 MBytes = 4254 prMB
      Sectorsize: 2048 Bytes
      Copy from SCSI (3,0,0) disk to file '/home/peter/birthday.iso'
      end:   2077632
      addr:  2077632 cnt: 64
      Time total: 277.602sec
      Read 4155264.00 kB at 14968.4 kB/sec.
    • dvdbackup

      The -o parameter specifies the output directory under which the DVD file structure will be copied. This directory does not need to be unique for your DVDs. This is because a title sub-directory will be created under it. For example, you can have a common ~/movies output directory for all your home movies with different titles.

      The -M parameter specifies that you want to "mirror", i.e., backup, the whole DVD.

      The optional -p parameter enables progress reporting during the backup operation.

      $ dvdbackup -p -M -i /dev/dvd -o ~/movies
      libdvdread: Using libdvdcss version 1.2.13 for DVD access
      libdvdread: Attempting to retrieve all CSS keys
      libdvdread: This can take a long time, please be patient
      libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x0000011e
      libdvdread: Elapsed time 0
      libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000358c
      libdvdread: Elapsed time 0
      libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00003710
      libdvdread: Elapsed time 0
      libdvdread: Found 1 VTS's
      libdvdread: Elapsed time 0
      Copying menu: 100% done (26/26 MiB)
      Copying menu: 100% done (1/1 MiB)
      Copying Title, part 1/4: 100% done (1024/1024 MiB)
      Copying Title, part 2/4: 100% done (1024/1024 MiB)
      Copying Title, part 3/4: 100% done (1024/1024 MiB)
      Copying Title, part 4/4: 100% done (958/958 MiB)
  4. Playback video.

    My favorite video player is VideoLAN, aka vlc. It can open an iso file as well as a title directory.

    To play back a DVD backed up using dvdbackup:

    $ vlc --fullscreen  ~/movies/2014birthday

    Note that 2014birthday is the title directory created under the ~/movies directory.

    To play back a DVD backed up using dd or readom, you need to first mount the iso file:

    $ sudo mkdir /mnt/iso
    $ sudo mount -t iso9660 -o ro,loop ~/birthday.iso /mnt/iso
    $ vlc --fullscreen  /mnt/iso

My next article discusses the same topic but introduces GUI tools.

Tuesday, April 1, 2014

Increase font size of virtual terminals

My earlier post shows how to change, on the fly, the font size of X terminal emulators. Besides terminal emulators, Linux provides six virtual terminals which you can bring up from X Window by pressing Control+Alt+F1 to Control+Alt+F6 keys respectively. This post explains how to adjust the font size of virtual terminals for Debian, Ubuntu, and their derivatives.

Replace console-tools with kbd

By default, Debian installs the console package console-tools instead of kbd. With console-tools, the console font is limited to 8 pixels wide. If your concern is eye fatigue, you do want a wider font. Installing the kbd package automatically removes console-tools.

$ sudo apt-get install kbd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  console-tools kbd-compat
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 2 to remove and 3 not upgraded.

View live

A bonus for installing kbd is the setfont utility that is included in the package. With setfont, you can temporarily change the font of a virtual terminal, and view it live to decide if you want to configure it permanently.

You can't arbitrarily pick a font for a virtual terminal. The available fonts are stored in the directory /usr/share/consolefonts.

The name of a font file - Uni2-Terminus28x14.psf.gz - tells you 3 key pieces of information:

  • Codeset.

    For English-speaking users, select the codeset Uni2 or Lat15.

  • Font face.

    Popular choices are Terminus and Fixed.

  • Font size.

    The font size is specified by 2 numbers in pixels represented as HEIGHT x WIDTH. If the width is 8 pixels, then only the height is specified. For comparison purposes, the default console font size is 16 (that is, 16 x 8).

To view a font live, press Control+Alt+F1 keys to bring up virtual terminal #1, and then execute the setfont command.

$ setfont /usr/share/consolefonts/Uni2-Terminus28x14.psf.gz

Configure permanently new font and font size

You can directly edit the console configuration file (/etc/default/console-setup). But, it is much easier to run the reconfigure program as below.

  1. Run dpkg-reconfigure.
    $ sudo dpkg-reconfigure console-setup
    [sudo] password for peter: 
  2. Select UTF-8.
  3. Select Combined - Latin; savic Cyrillic; Greek.

    This corresponds to the Uni2 codeset.

  4. Select Terminus.
  5. Select the desired font size.
  6. Run setupcon in virtual terminals.

    If you now switch to a virtual terminal, you will still see the old font size until you run the following command from the virtual terminal.

    $ setupcon

Thursday, March 27, 2014

How to change font size of terminal emulators on the fly

There is no shortage of Linux X Window terminal emulators. For a power user who works long hours with the terminal, it is important to know how to zoom in, that is, make the text larger. Your strained eyes will thank you for it.

The table below summarizes how to increase and decrease the font size on the fly for an non-exhaustive list of terminal emulators.

Terminal emulators + font size - font size
xterm Shift + Keypad Plus(+) Shift + Keypad Minus(-)
GNOME terminal Control + Shift + Plus(+)
Do not use keypad.
Control + Minus(-) Do not use keypad.
Terminator Control + Shift + Plus(+)
Do not use keypad.
Control + Minus(-) Do not use keypad.
Konsole Control + Mouse Wheel Scroll Up, or
Control + Plus(+)
Control + Mouse Wheel Scroll Down, or
Control + Minus(-)
lilyterm Control + Plus(+)
Do not press Shift, or use keypad.
Control + Minus(-)
Do not use keypad.
xfce4-terminal Right Click/Preferences/Appearance. No keyboard or mouse shortcut.
lxterminal Edit/Preferences/Style. No keyboard or mouse shortcut.
mlterm Control + Right click to bring up settings. Encoding tab/Font Size. No keyboard or mouse shortcut.
kterm Control + Right click to bring up font size menu.
rxvt-unicode (urxvt) Doable but archaic. Issue printf command inside terminal window.
Eg: printf '\33]50;%s\007' "xft:DejaVu Sans Mono-8"

My next post aims to further reduce your eye strain by increasing the font size of virtual terminals.