You are not logged in.

#1 2019-12-15 04:44:54

clusterF
Member
Registered: 2019-05-07
Posts: 509

Create iso from bootable usb

Usually linux forums are asked how to burn or copy an iso to usb but im wondering how to do the reverse?

I found this article here using gnome-disk-utilty but im wondering if there are any other methods? I usually dd iso's onto usb, perhaps there is a reverse method?

https://www.ostechnix.com/create-iso-bo … ive-linux/


"Ad Astra Incrementis"

git: clusterF

Offline

#2 2019-12-15 13:31:40

clusterF
Member
Registered: 2019-05-07
Posts: 509

Re: Create iso from bootable usb

Have not been able to find any methods to copy more than one partition from a usb using dd to have a local iso copy of a bootable usb.

Next best method ive read is to dd dev to dev and confirmed it working with the lithium iso. Making sure the destination usb drive is of equal or greater size.

dd if=/dev/sdX of=/dev/sdY


"Ad Astra Incrementis"

git: clusterF

Offline

#3 2019-12-15 14:06:57

glittersloth
...always giving it to you straight
Registered: 2015-09-30
Posts: 974

Re: Create iso from bootable usb

I'm assuming you attempted...

if=/dev/sdX of=/home/clusterF/Downloads/distros/name_of_distro.iso

... and were unsuccessful?

Sorry, but I don't quite understand the "copy more than one partition" bit you mentioned.

Last edited by glittersloth (2019-12-15 14:12:25)

Offline

#4 2019-12-15 14:39:47

clusterF
Member
Registered: 2019-05-07
Posts: 509

Re: Create iso from bootable usb

glittersloth wrote:

I'm assuming you attempted...

if=/dev/sdX of=/home/clusterF/Downloads/distros/name_of_distro.iso

... and were unsuccessful?

Sorry, but I don't quite understand the "copy more than one partition" bit you mentioned.

That dd method wont copy over the boot partition created when dd iso to usb, maybe im missing something but when i tried that method it copied the whole usb data size, so 7 gb in iso size instead of 1.1gb for sdb1 and 736k for sdb2. dd the created iso from

if=/dev/sdX of=/home/clusterF/Downloads/distros/name_of_distro.iso

to usb again and boot fails.

Last edited by clusterF (2019-12-15 14:46:18)


"Ad Astra Incrementis"

git: clusterF

Offline

#5 2019-12-15 15:25:40

glittersloth
...always giving it to you straight
Registered: 2015-09-30
Posts: 974

Re: Create iso from bootable usb

Ah, forgot about needing it to be bootable. Never attempted extracting an ISO from a bootable USB before so was shooting blindly. Sorry.

My knowledge in this area is dated (I sort of lost touch during the transition to UEFI days) but iirc an iso extracted from bootable media won't be bootable in itself. You'll have to manually set boot flags. I'm guessing a you'd need a combination of mkisofs and isolinux in order to create a bootable image.

Offline

#6 2019-12-15 16:19:39

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 708

Re: Create iso from bootable usb

AFAIK, as long as partitions are not mounted this should work:

# copy unmounted disk to iso on USB disk
$ sudo dd if=/dev/sdX of=/usbmountpoint/some_name.iso bs=4M; sync

# copy iso from USB on empty disk:
$ sudo dd if=/usbmountpoint/some_name.iso of=/dev/sdY

I distinctly remember migrating Win10 installation from 128GB m2 SSD to 256GB ms SSD on a laptop, this year. (Although, I don't remember how exactly I told Win10 to recognize disk has been enlarged, but it wasn't complicated ...).

This should also work:

# copy unmounted disk to another unmounted disk
$ sudo dd if=/dev/sdX of=/dev/sdY bs=4M; sync

It is assumed the size of the sdY is at least equal to the size of sdX. Also, none of these disks were mounted during 'dd'; one should use live distro; BL-live could suffice, but more special grml or similar is more powerful and has more up-to-date packages.

Note: 'sync' is highly recommended. 'bs=4M' is probably a bit faster than using default blocksize.


Postpone all your duties; if you die, you won't have to do them ..

Offline

#7 2019-12-16 10:25:42

clusterF
Member
Registered: 2019-05-07
Posts: 509

Re: Create iso from bootable usb

iMBeCil wrote:

This should also work:

# copy unmounted disk to another unmounted disk
$ sudo dd if=/dev/sdX of=/dev/sdY bs=4M; sync

It is assumed the size of the sdY is at least equal to the size of sdX. Also, none of these disks were mounted during 'dd'; one should use live distro; BL-live could suffice, but more special grml or similar is more powerful and has more up-to-date packages.

Note: 'sync' is highly recommended. 'bs=4M' is probably a bit faster than using default blocksize.

Yes i tried that method and its a workaround to extracting a local iso.


"Ad Astra Incrementis"

git: clusterF

Offline

Board footer

Powered by FluxBB