dd not creating bootable ISO files

68 views
Skip to first unread message

sami....@gmail.com

unread,
Feb 16, 2023, 10:53:00 AM2/16/23
to Linux Users Group
I've customized a Ubuntu 20.04 boot USB instance.  The install works fine and is completely automated.  I can use dd to create a copy of the USB, that is coy USB to USB.  That works fine.  

However I need to create a file based image of the iso to distribute to users.

dd commands copies the data to another USB but does not make it bootable.

An ideas?  Thanks in advance.

Jeremiah Bess

unread,
Feb 16, 2023, 10:54:47 AM2/16/23
to linuxus...@googlegroups.com
Can you share the commands you are using leading up to the point where it doesn't work?

Jeremiah Bess


--
--
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to linuxus...@googlegroups.com
To unsubscribe, send email to linuxusersgro...@googlegroups.com
For more options, visit our group at http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules)
---
You received this message because you are subscribed to the Google Groups "Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linuxusersgro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linuxusersgroup/368bfa97-5a5b-426b-a75f-9e1844ab24e9n%40googlegroups.com.

sami....@gmail.com

unread,
Feb 16, 2023, 3:14:35 PM2/16/23
to Linux Users Group
I've tried the following, none worked...

dd if=/dev/sda1 of=/ubuntu.iso bs=4K  
mkisofs  -o  /dev/sda  /
mkisofs  -o  /dev/sda1  /

Those commands will create a the data o the iso, however the iso does not boot.

thanks,

Jeremiah Bess

unread,
Feb 16, 2023, 3:38:32 PM2/16/23
to linuxus...@googlegroups.com
So if your USB device is /dev/sda, the sda1 is just a single partition on that drive. The boot loader is stored in the first blocks at the beginning of the USB drive: sda not sda1

The sda drive is typically the first drive used to boot an OS. So just a note, you probably shouldn't try to create an ISO image from an OS that is currently running. Files are changing all the time and could cause corruption. Rather, boot to some other OS to run the dd command (assuming it's a Linux OS you booted to).

Try this, replacing sdX with the USB device path (do not use partition numbers at the end) you want to clone (use df -hT to list possibilities, but be sure which you choose!):
sudo dd if=/dev/sdX of=ubuntu.iso

This command copies the entire drive contents, the boot sector and any partitions. As an example, I have a bootable flash drive with Ventoy installed. If I want to make an .iso of that, I would first boot to an OS on my hard drive, in this case, Linux Mint. Next, I need to find the drive path:

jbess@scooter:~$ df -hT
df: /run/user/1000/doc: Operation not permitted
Filesystem                  Type      Size  Used Avail Use% Mounted on
udev                        devtmpfs   15G     0   15G   0% /dev
tmpfs                       tmpfs     3.0G  1.6M  3.0G   1% /run
/dev/mapper/lvmlmde-root    ext4      428G  215G  191G  53% /
tmpfs                       tmpfs      15G   98M   15G   1% /dev/shm
tmpfs                       tmpfs     5.0M  4.0K  5.0M   1% /run/lock
/dev/sda1                   vfat      286M  5.8M  280M   3% /boot/efi
tmpfs                       tmpfs     3.0G  176K  3.0G   1% /run/user/1000
/dev/sdb2                   vfat       32M   28M  4.7M  86% /media/jbess/VTOYEFI
/dev/sdb1                   exfat      29G   23G  6.5G  78% /media/jbess/Ventoy


In this case, /dev/sdb is the drive path, and I'm ignoring the two numbered partitions listed there. Next, I would run the dd command:

sudo dd if=/dev/sdb of=ventoy.iso

Does that help? Another alternative is to use another bootable CD/DVD like Clonezilla or some other drive cloning software. Most can create an .iso from an existing file system.

Jeremiah Bess


Reply all
Reply to author
Forward
0 new messages