Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yumi.
Perfect tool for Windows people to wet their feet in Linux.
The problem with dd is it wipes everything out, and requires Linux.
I remember back in the days, it was always an issue to burn an iso in Windows to get rid of Windows and install GNU/Linux. Haha, so annoying.
Anyways, there were solutions, but none of them really good or simple. In the end you had to download some exe file with all kinds of malware and such from untrusted sources just to be able to burn an iso to a cd or dvd. But yes, there were ofcourse also higher quality and less risky choices like Nero (ehem, the name, huh). I don't even want to imagine how to put an iso on a USB disk in Windows.
I think we can count it a very good thing that we have things such as dd, but also things such as k3b and everything in between. Everyting is just easier in GNU/Linux, including getting and deploying a(nother) new GNU/Linux distro on a PC. Even getting and deploying Windows is easier in GNU/Linux! Yes, I was quite surprised MS distributed Windows (7) as downloadable ISO files, but they do.
What is that you like about dd ? I find it just too slow. I must mention one thing. Once I used dd to burn an ISO to USB & got "I/O error" while installing then I burned the same ISO using Etcher & installation completed successfully. Why that happened ? I have no idea.
I always use dd.
The thing many people don't realize about dd is that the default block size with dd is 512 so for a common iso file on a filesystem that uses a 4096 sector size it takes 8 block reads for a single sector. The extra tiny reads slows things down drastically.
I use something like "dd if=inputfile.iso of=/dev/sdf bs=16M" and never have a complaint about speed. The most limiting thing about speed with that command is the write speed on the usb device.
I sometimes use ventoy as that allows having more than one iso available on a single usb but for home use dd seems more user friendly as having the iso on the usb to directly control the boot eliminates the "boot ventoy -> select iso -> boot iso" part of the process.
Other tools such as etcher may fit your needs / wants / perceptions better.
Another good tool for burning an iso to usb is Fedora Media Writer. It works similar to etcher, and will verify the copy as it goes. The verification would likely have prevented the I/O error you mentioned. It also is able to restore the usb to its original partitioning when used to remove the iso from the usb.
Last edited by computersavvy; 07-22-2021 at 07:05 PM.
I recently tried Fedora Media Writer on Win10 to write F34 to a USB. Worked liked a charm. Supposed to be more aware of the needs of hybrid isos - and not just Fedora apparently.
I didn't know you could use cp to write to a raw device.
I don't know what's better to use between cp and dd, but using the cp command seems more simple to me. Plus it's mentioned at the Debian pages I linked to above. I've been using:
Code:
# cp distro.iso /dev/sdX && sync
[If the cp command is successful, by default, no output is diplayed. To view output, use the -v (--verbose) option.]
For example, I called this one up just now from my bash history:
The cp command will copy the file to the usb device, on an existing file system. Using the cp command does not burn the iso to the device and make it bootable.
If you are using a ventoy usb device then the cp command is appropriate. If you want the device to be bootable directly to the iso image you are writing to it then one of the other tools mentioned earlier (dd, etcher, fedora media writer, k3b, and others) is needed to "burn" the image to the usb device.
The cp command will copy the file to the usb device, on an existing file system. Using the cp command does not burn the iso to the device and make it bootable.
I've been using cp to write isos to flash drives, then booting into live sessions or using the flash drives for installations. Worked for Linux Mint 20.1 (Xfce), too. I don't understand why you say it won't make it bootable (??).
I've been using cp to write isos to flash drives, then booting into live sessions or using the flash drives for installations. Worked for Linux Mint 20.1 (Xfce), too. I don't understand why you say it won't make it bootable (??).
Can you give a functional command line that does what you say? I would like to try that.
Will copy myfile.iso onto the filesystem of /dev/sdb1, just like it would any other file. When you mount that drive you will see a file on it named myfile.iso. I suppose that you can mount that .iso loopback and use it for something.
Code:
dd if=myfile.iso of=/dev/sdb bs=1M
Will do a bit by bit copy of the .iso to the device sdb. If you don't specify, it will start writing on the first bit of the device. When it is done the device will be the same size as the iso. In fact, you will need to partition it, and put a file system on the partition to use it for anything else, and to make it full size again.
Can you give a functional command line that does what you say? I would like to try that.
I gave examples in my 2nd post in this thread, and provided links to Debian's documentation in my first post.
Today, I found my flash drive that contained LM 20.1, plugged it in, made sure it was unmounted (I ran lsblk), then simply ran the following from the directory containing the LM 20.2 iso:
When that finished, I rebooted the computer with that flash drive, into Linux Mint 20.2. So that's a "functional" command for ya. Obviously don't type the "$" at the beginning, and maybe you don't use sudo.
I guess I should add that if it's a brand new flash drive I use GParted on it first, creating a new msdos partition table and a new FAT32 partition that takes up the entire drive.
I don't know if cp works with every distro, but so far I've used it instead of dd with Debian, Linux Mint, MX Linux, and Kubuntu.
Well, thank you for that info. Using cp certainly works for writing an iso to a raw usb device. I suspect that is a special case though since writing to other raw devices such as an SSD or HDD would be different due to the partitioning. With a usb that is intended to be a copy of the iso it works.
The one thing that I see though is that there is no way to specify the block size as there is with dd so speed may or may not be the same.
I guess you can teach some old dogs new tricks, and I will tuck that one back for later use.
Will copy myfile.iso onto the filesystem of /dev/sdb1, just like it would any other file. When you mount that drive you will see a file on it named myfile.iso. I suppose that you can mount that .iso loopback and use it for something.
I still don't get this. /dev/sdb1 is a raw partition, not a filesystem. How would the cp command even know what filesystem was on it? Surely the way to copy the file as a file would be something like
Code:
mount -t type /dev/sdb1 /media/usb
cp myfile.iso /media/usb
I think "cp myfile.iso /dev/sdb1" would write to the raw partition and replace any file system formatting, similar to what I saw with "cp myfile.iso /dev/sdb" where it overwrote the partition table, etc.
I have not tried it that way, but since I have already seen that I can use "cp myfile.iso /dev/sdb" to 'burn' an iso image to the raw device, then I really have nothing that says writing to the partition would not work similarly. Logic says that doing so would replace the filesystem formatting with the iso image, but without testing I cannot be certain.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.