Create a live USB with additional partitions

I am looking for a way to create a Fedora live usb with additional partitions. Using the regular dd method I cannot add an additional partition to store data. My goal is to have one usb drive on my keyring which I can use to troubleshoot/reinstall computers (live Fedora) and which I can also use to exchange data with others. Any hints appreciated.

I guess that is what you are looking for?!
https://docs.fedoraproject.org/en-US/quick-docs/creating-and-using-a-live-installation-image/index.html#Data_persistence

2 Likes

This looks really good, thanks. It seems like only the livecd-iso-to-disk is able to keep/create additional partitions. Now I only would need to find a way to make it work. So far I always get an error, regardless of what option I use:
Error 1 detected at line 2028 /usr/bin/livecd-iso-to-disk
So as of now my problem is not solved yet.

EDIT: The suggested livecd-iso-to-disk approach works using an older Fedora 36 beta image, but not for the recent Fedora 37 beta image. So open for other approaches.

1 Like
bash file /usr/bin/livecd-iso-to-disk

  2027	rm -rf usr
  2028	ikernel=$(lsinitrd $i --unpack -f usr/lib/modules/*/kernel -v 2>&1)
  2029	ikernel=${ikernel%/*}; ikernel=${ikernel##*/}

It seams that the kernel version not exists yet or the modules are missing in F37.
In other words the package is not F37 ready.

Last metadata expiration check: 0:54:44 ago on qui 06 out 2022 22:45:23.
Installed Packages
Name         : livecd-tools
Epoch        : 1
Version      : 31.0
Release      : 1.fc36
Architecture : x86_64
Size         : 206 k
Source       : livecd-tools-31.0-1.fc36.src.rpm
Repository   : @System
From repo    : updates
Summary      : Tools for building live CDs
URL          : https://github.com/livecd-tools/livecd-tools
License      : GPLv2
Description  : Tools for generating live CDs on Fedora based systems including
             : derived distributions such as RHEL, CentOS and others. See
             : http://fedoraproject.org/wiki/FedoraLiveCD for more details.

Did you try to install the package above in F37? Which version do you have dnf info livecd-tools ?

Thanks for your reply. I have reported it on the upstream github repo, and a contributor commented that the iso structure of F37 changed and a new version of livecd-iso-to-disk is required and being worked on.

I don’t quite understand the end of your post. I am running F36 and want to make a usb-stick with an F37 image. So I currently have no running F37 and cannot try to install the livecd-tools package in F37.

So on my F36 install dnf info livecd-iso-to-mediums is version 31.0.

I have tried in F36 with this command:

sudo livecd-iso-to-disk --format msdos --reset-mbr Fedora-LXDE-Live-x86_64-37-1.7.iso /dev/sda

and it gave the error:

It is OK to use this media.
Error 1 detected at line 2028 /usr/bin/livecd-iso-to-disk

And I’m also usong version 31.0 of livecd-iso-to-disk

Hello and welcome to ask :fedora:

Have you read the man page for livecd-iso-to-disk ?

SYNOPSIS
       livecd-iso-to-disk  [--format [<size>[,fstype[,blksz[,extra_attr,s]]]]] [--msdos] [--efi] [--noesp] [--reset-mbr] [--multi]
       [--livedir <directory>] [--skipcopy] [--noverify] [--force] [--xo] [--xo-no-home] [--timeout <duration>] [--totaltimeout
       <duration>] [--nobootmsg] [--nomenu] [--extra-kernel-args <arg s>] [--compress] [--skipcompress] [--no-overlay] [--overlayfs
       [temp]] [--overlay-size-mb <size>[,fstype[,blksz]]] [--copy-overlay] [--reset-overlay] [--home-size-mb <size>[,fstype,blksz]]]
       [--copy-home] [--delete-home] [--crypted-home] [--unencrypted-home] [--swap-size-mb <size>] [--updates <updates.img>] [--ks
       <kickstart>] [--label <label>] [--help]  <source> <target partition/device>

and

OPTIONS
       --format [sizemb[,fstype[,blksz[,extra_attr,s]]]]
           Partitions and formats the target device, creates an MS-DOS partition table or GUID partition table (GPT), if the --efi
           option is passed, creates 1 to 3 partitions, and invokes the --reset-mbr action.

           NOTE WELL: All current disk content will be lost.

               Partition 1 is sized as requested or as available & fstype formatted.  fstype may be: ext[432](ext4
               default)|fat|vfat|msdos|btrfs|xfs|f2fs  (extra_attr,s may be passed to f2fs formatting, for example, "--format
               f2fs,-,extra_attr,compression"  Until GRUB's f2fs.mod is updated, any extra_attr will require booting with an EFI Boot
               Stub loader, such as the one from dracut triggered by the above format request.) Partition 1 is labelled as before or
               requested, flagged as bootable, and may allow an optional block size.

               Partition 2 is fat16 formatted and labelled 'EFI System Partition'.

               Partition 3 is HFS+ formatted and labelled as 'Mac'.

                   Creation of partitions 2 & 3 is dependent on the presence of the files /images/efiboot.img & /images/macboot.img in
                   the source.

       --msdos   (a legacy option. Use the --format msdos syntax instead.)
           Forces format to use the msdos (vfat) filesystem instead of ext4.

It seems your command line is not properly structured. You are forcing the format to vfat instead of allowing it to use ext4 as the file system. This may not be functional.

The issue with livecd-tools is not yet closed as of today:

Maybe an edit of the instructions would help others not to waste their time either on old versions of livecd-tools.

1 Like

That is not how opensource software works. If you have something to contribute, like help to fix the problem, your comments alias your pull requests are welcome. If you do not have the ability to help on a constructive way, please let it be to tell others what they have to do!

Every time you answer to a request like this one here, people who are involved get a notification. Reading nonsense is a waist of time. If you believe there should be a notification in the documentation please make a proposal as described here:

Fedora Docs "HowTo" for casual contributions :: Fedora Docs