- Creating a bootable USB stick
- Changing language settings
- Debian Live USB Persistence for Debian 13 (Trixie)
- See Also
Debian Live
These instructions relate to version 8.5.0 of the Debian Live Project.
Creating a bootable USB stick
See the 'Debian Live USB Persistence for Debian 13 (Trixie)' section below for up-to-date instructions for creating a bootable USB stick for Debian 13 (Trixie).
Instructions for creating a bootable USB are in Section 4.3 of the Debian GNU/Linux Installation Guide. To summarise:
WARNING Make sure everything you care about on your machine is fully backed up. Mistakes in these commands can make it very difficult or impossible to recover data. Take great care when specifying the target device that you are certain it is the correct one.
Download one of the hybrid Debian Live images from https://www.debian.org/CD/live/ e.g. http://cdimage.debian.org/debian-cd/current-live/i386/iso-hybrid/debian-live-8.5.0-i386-lxde-desktop.iso
Ideally boot into a Debian system or boot from a Debian live CD/DVD.
Clear the kernel message buffer to make it easier to identify messages.
$ sudo dmesg -cInsert in the target USB key to be entirely overwritten with the Debian Live image.
Examine the messages in the kernel buffer to see what device name has been assigned. It is likely to be something like
/dev/sdb,/dev/sdcetc. Additionally each partition will be given a unique name such as/dev/sdb1,/dev/sdb2$ dmesgAdditionally you can use the
mountcommand before and after to see what device name is assigned.$ mountIf the device has been automatically mounted, unmount it, using the relevant device name (replace X with the appropriate letter). When writing directly to a device it must be unmounted.
$ sudo umount /dev/sdXCopy the ISO image directly to the device. The target will be the entire device, not just a partition. E.g.
/dev/sdbnot/dev/sdb1. WARNING make certain the target is the USB stick. The target device will be overwritten by the ISO image.$ sudo cp debian.iso /dev/sdX $ syncPhysically remove and reinsert the USB stick to ensure the operating system recognises the new partitions.
The ISO image will have structured the partition table of the USB stick to have one bootable hidden partition with the rest of the USB stick remaining free. Optionally create a new FAT32 partition using a utility such as
cfdiskand format it using themkfs.vfatcommand.mkfs.vfatis in the Debiandosfstoolspackage. Seeman cfdiskandman mkfs.vfatfor further information.For most uses, choose a partition type ID of 0xc in
cfdisk. Format the partition withsudo mkfs.vfat -F 32 /dev/sdX2replacingX2with the relevant partion name.Again, run the
synccommand, eject and physically remove the USB stick to ensure that the new partition is recognised.Having created a second partition, it may be useful to have the 'non-free' firmware that is not included in the standard Debian installer. A set of non-free packages can be downloaded from http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/ or alternatively, the individual package(s) can be downloaded by searching the Debian packages. E.g. http://packages.debian.org/search?keywords=firmware. Place the extra firmware packages in a directory named
firmwareoff the root of the partition. The installer should automatically find these packages and potentially install any that are required.$ cd /media/user/NO\ NAME $ sudo mkdir firmware $ cd firmware $ sudo tar -xf /path/to/firmware.tar.gz
You should now have a bootable Debian Live USB stick with which to use as an installer or for rescuing a non-bootable system.
Changing language settings
Having booted off the Debian Live USB stick, you may wish to change the language settings.
Language
See ChangeLanguage for full information, but essentially:
$ sudo dpkg-reconfigure locales
and select the locales you wish to enable, including choosing the system wide
default locale. It takes quite a while to generate each locale, so only
enabling those ones you require saves time. E.g. en_GB.UTF-8 should British
English users.
Keyboard
The keyboard can be changed using the setxkbmap command in a terminal
window. See Keyboard and X11KeyboardTips for more
information. e.g. To change the keyboard mapping for the United Kingdom
$ setxkbmap gb
A more thorough and perhaps easier way to fully configure the keyboard setup is to use:
$ sudo dpkg-reconfigure keyboard-configuration
$ sudo systemctl restart keyboard-setup.service
-- Frank Dean - 2 Aug 2016
Debian Live USB Persistence for Debian 13 (Trixie)
These notes provide a little more assistance in following the DebianLive/LiveUsbPersistence - Debian Wiki guide.
See customizing-run-time-behaviours - Debian Live Manual for full details of how the persistence mechanism is implemented.
These instructions based on How to create a Debian live USB with persistence? - Unix & Linux Stack Exchange
This was tested using debian-live-13.5.0-amd64-lxde.iso.
To use a persistent volume, the grub boot needs to include the string
persistence. When booting, the system will use various rules to find the
volume marked to be used for persistentence. To do this, we use sed as a
way of modifying the ISO image to contain persistence as part of the default
grub boot process. This saves having to edit the grub boot parameters on each
boot.
Download the ISO and make a modified copy of it, replacing the harmless
splash quiet string in the grub configuration with persistence. As root:
# LANG=C sed 's/splash quiet/persistence /;s/quiet splash/persistence /' \
< debian-live-13.5.0-amd64-lxde.iso \
>debian-live-13.5.0-amd64-lxde-persist.iso
We can't use cfdisk as it removes the ISO9660 partition.
Install the modified Debian ISO on the USB stick.
$ sudo dd if=<file> of=<device> bs=16M status=progress oflag=sync
The USB device will now have two primary partitions on it.
Use fdisk to add a third partition as type 83 Linux formatted with ext4
with the label persistence.
$ sudo fdisk /dev/sdX
n # new partition
p # primary
<Return> # default: 3
<Return> # default: next free sector
<Return> # default: last addressable sector or size, e.g. +10G
w # write and quit
$ sudo mkfs.ext4 -L persistence /dev/sdX3
$ sudo mkdir /mnt/sdX3
$ sudo mount /dev/sdX3 /mnt/sdX3
$ sudo '/ union' | tee /mnt/sdX3/persistence.conf
$ sync
$ sudo umount /mnt/sdX3
To list partition labels:
$ lsblk -o name,parttype,parttypename,fstype,label <DEVICE>
Labels are a maximum of 11 characters.
Label a FAT32 partition:
$ sudo fatlabel /dev/sda1 DEBIAN_LIVE
or label it when formatting:
$ mkfs.vfat -n <LABEL> <DEVICE>
Label an ext4 partition:
$ sudo e2label /dev/sda5 persistence
or label it when formatting:
$ sudo mkfs.ext4 -L <LABEL> <DEVICE>
Ref: How do I change the "label" reported by lsblk?
-- Frank Dean - 29 May 2026
See Also
Another option is to use UNetbootin which distributes binaries for Linux, Mac OS X and Windows. The application can use an existing ISO or alternatively download one for you.
Related Topics: DebianLiveLenovoT500Wireless, DebianTips, KnoppixTips, X11KeyboardTips