Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create ISO image from folder

I wrote a script which creates and ISO image from a folder, but when the folder contains spaces, I get an error message. Can somebody please help me? I'm working with Mac OSX Mavericks and Terminal.

Thanks in advance.

Script:

#!/bin/sh
cd /Volumes/Daten/fake
for i in ./*; do hdiutil makehybrid -udf -joliet -iso -o /Volumes/Daten/test/$i ./*;done

error:

hdiutil: makehybrid: multiple sources specified
like image 202
moses19850 Avatar asked Mar 07 '15 21:03

moses19850


People also ask

Can you create ISO image from files?

In the tool, select Create installation media (USB flash drive, DVD, or ISO) for another PC > Next. Select the language, architecture, and edition of Windows, you need and select Next. Select ISO file > Next, and the tool will create your ISO file for you.

Can Windows 10 create ISO files?

Windows doesn't have a built-in way to create ISO files, although modern versions of Windows— Windows 8, 8.1, and 10—can all natively mount ISO files without any additional software. To actually create an ISO file from your own physical disc, you'll need a third-party program.


Video Answer


2 Answers

Use double-quotes around all variable references (e.g. "$i") to prevent word splitting. BTW, it also looks like your script will fail if there's more than one item in /Volumes/Daten/fake, because the ./* at the end of the hdiutil command will try to include all of the items in each image, which will also fail. Finally, ./* is generally unnecessary; just use *. I think you want this:

#!/bin/sh
cd /Volumes/Daten/fake
for i in *; do
    hdiutil makehybrid -udf -joliet -iso -o "/Volumes/Daten/test/$i" "$i"
done
like image 164
Gordon Davisson Avatar answered Oct 19 '22 23:10

Gordon Davisson


Launch disk utility and select new>blank disk image from folder... It's as simple as that!

like image 25
mas0701 Avatar answered Oct 20 '22 01:10

mas0701