Exporting from a Tumbleweed LiveUSB to an ISO

I have a USB drive that was a Tumbleweed LiveUSB. I’ve added a few applications, customized it with some helpful scripts, chanced the hostname, etc. It works great, I can boot to it from one system, shutdown, then go to another and pick up where I left off.

Now, I want to export it to an ISO file to do other things or make copies, but if I try to do that, I get a generic Tumbleweed LiveUSB, not my customization.

I expect this is because all of my changes are stored in the cow partition, which is overlaying nicely when I boot to the USB, but when it becomes a bootable ISO, it doesn’t do that.

How do I get it to do that?

My ultimate goal is to be able to take the customized ISO, then send it across a iVentoy PxE boot. I’ve got that side of it working, I just need this USB as an ISO to be able to use it.

You forgot to describe how you did it.

I have tried a few. The first way was:

sudo dd status=progress if=/dev/sda of=MyDisk.iso

then I tried to figure out the mkisofs command, and I am pretty sure I just screwed that up each time.

sudo mkisofs -o MyDisk-PxE.iso -b ISOboot/linux -c ISOboot/initrd -joliet-long /run/media/alexius/cow/rw/

Looks fine to me. But for some unexplained reason your are not satisfied with the result?

The resulting ISO boots, but it boots into a fresh LiveUSB. All of the chances I have made are gone.

For example, I changed the wallpaper. When I boot my actual USB, I have the new wallpaper image, but if I boot from the ISO file (either through the PxE method or when I tried a VirtualBox boot) I get the LiveUSB default desktop.

That of course is not going to work, changed files are outside of iso9660 filesystem.

If your modifications are strictly changing existing and adding new files, mksusecd may work by applying CoW partition content over the original ISO. Otherwise I would consider kiwi and integrating your "some helpful scripts` into build process.

I agree that the result might not be “an ISO” (but after all the .iso suffix is just that, a suffix maybe for human remembering). But when the original device was bootable, dd-ing it to a file and then dd-ing that file to another device should in my opinion result in again a bootable device.

This sounds like what I want to do at this point. Is there any specific resources you can point me to for that? (I found the Man page, but that is a lot to wade through to start with.)

Bootable, yes. All of the customization, no. I end up with a new LiveUSB as if I had jsut downloaded and burned it.

Not much beyond the github project.

I tried the mksusecd command, but it did not work.

mksusecd --verbose -c MyDisk.iso --volume=MyDisk --preparer=LexPendragon --title=MyDisk /run/media/alexius/openSUSE_Tumbleweed_KDE_Live/ /run/media/alexius/cow/

Some files in /run/media/alexius/cow are not user-readable; you need root privileges.

I thought it might be the directories, so I unmounted the partitions, make ISOs, and tried it with ISO, and that didn’t work either.

mksusecd --verbose -c MyDisk.iso --volume=MyDisk --preparer=LexPendragon --title=MyDisk openSUSE_Tumbleweed_KDE_Live.iso Cow.iso 
Cow.iso: unsupported source type

Is there a way I can just open a Live USB and manually copy cow/rw overtop of it?

And did you do what it told you?

Yes, I was running it with sudo, and after it told me that I ran it in a root shell, and still got those errors.

Then why didn’t you show the full command?

And what exactly does it mean?

Because the first time I ran it with sudo, it failed, so when I ran it again afterwards in the root shell that was the full command.

It failed with the error message included in the code block. I am not entirely clear as to what each means, which is why I had posted them. The first appears to tell me I need root permissions, which was confusing because it had root permissions when I ran it. The second seemed to indicate that I couldn’t add an ISO on top of another ISO.

If you simply had included the complete command line (together with the shell prompt where you typed it), the full command output and subsequent shell prompt it saved two round trips and time spent asking for this information.

Anyway, mksusecd invokes find \! -readable. Check files that are listed - what makes them not readable by root.

After looking more closely - no. The content of Live image is created as compressed squashfs filesystem which further contains ext4 image for the root filesystem. squashfs is read-only by definition, you would need to extract the root image from the squashfs container, modify it and then re-create squashfs with updated image. Then you will need to replace the squashfs container in ISO. The last step is the most trivial one :slight_smile:

And to avoid diving deep into overlayfs internals, I would mount root using overlay, like it is done during Live boot, and then copy the result to the new ext4 image.

Hello I wonder why don’t you make your custom image in OBS https://www.youtube.com/watch?v=Qg7r_swbkCY

Similar steps would apply on TW based image.