LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Copying ISO to thumb drive using 'dd' causes thumb drive to be read-only? (https://www.linuxquestions.org/questions/linux-general-1/copying-iso-to-thumb-drive-using-dd-causes-thumb-drive-to-be-read-only-4175646191/)

ahc_fan 01-14-2019 11:16 AM

Copying ISO to thumb drive using 'dd' causes thumb drive to be read-only?
 
I'm not sure why this happens, but whenever I copy a Linux ISO to a USB thumb drive using the dd command the thumb drive becomes read-only. I need to copy additional files onto the drive. Why is the thumb drive read-only? Should I try another method? I would try unetbootin but it almost never creates a bootable drive.

Edit: I did try to create a new ISO with the additional files that I need, but then it was not longer bootable.

yancek 01-14-2019 12:39 PM

Because an iso9669 filesystem is read-only by design and whatever software you use will do that. Try booting another Linux OS and use GParted/Parted or similar software to shrink the partition on which you have the Linux iso and create another partition.

ehartman 01-14-2019 12:49 PM

Quote:

Originally Posted by ahc_fan (Post 5948991)
Why is the thumb drive read-only? Should I try another method?

I don't think the thumb drive itself is read-only but as an ISO fs is read-only all of the files and directories, including its root directory probably are read-only.
See if you can change the mount directory OF the thumb stick to read-write (with the stick mounted, of course)
Code:

chmod +w /path/to/mount/dir
If that works you can do the same for those directories on the stick you want to put extra files in.
You also look into the iso itself by mounting it through the "loop" option
Code:

mount -o loop <iso_filename> /mount/dir
to see what the attributes inside are, especially those of directories (as you don't want to change files, the fact that they may be read-only doesn't matter). But you cannot put any files in read-only directories.

Brains 01-14-2019 09:39 PM

Quote:

Originally Posted by ahc_fan (Post 5948991)
Should I try another method?

My favorite is Rufus, but only runs on Windows. You can try etcher, not sure if it's free.

ahc_fan 01-15-2019 04:38 AM

Thanks you all. I didn't realize the ISO would continue being read-only once copied onto a USB like that. Could you explain why adding files to the ISO would stop it being bootable? All I did was mount the ISO, copy the contents to another directory, copy my files into the new directory, and then created a new ISO from the new directory using mkisofs.

ehartman 01-15-2019 04:51 AM

Quote:

Originally Posted by ahc_fan (Post 5949295)
Could you explain why adding files to the ISO would stop it being bootable? All I did was mount the ISO, copy the contents to another directory,

Being bootable is not a FILE, it is a special block (with the bootloader) in the beginning of the iso image.
When you copied all files to a new tree you would have to make the new iso bootable again. i.e. by applying isolinux (www.syslinux.org/wiki/index.php?title=ISOLINUX to that iso file.
BTW: syslinux itself is more versatile, you can also make images for a USB stick bootable with that and it doesn't have to be read-only.
Adding files to the original ISO image shouldn't make any difference, but as I said, you will have to change some directories to read-write to be able to do so.

colorpurple21859 01-15-2019 05:05 AM

maybe this will help https://help.ubuntu.com/community/US...lation%20Media https://www.makeuseof.com/tag/10-too...-usb-iso-file/

yancek 01-15-2019 07:49 AM

Quote:

Could you explain why adding files to the ISO would stop it being bootable?
In and of itself, that should not happen. What files and where were they located and did they affect the system or boot files?

You should be able to use the Live usb to add data, install additional software, etc. limited by the size of the usb and of course, NEVER RE-BOOTING. Once you reboot, every change is lost.

Alternatives are using a live usb created with persistence.
You can also create an additional partition on the usb to use space not used by the live iso install from another Linux system. YOu should be able to copy data to that partiition and save it and have it on reboot. This would require you to create a mount point for the partition and to manually mount it on each reboot.

I'm not sure what your end goal is but, if you want to have a system on a usb on which you can save data and install software is either a persistent install or better, a full install to the usb.

hydrurga 01-15-2019 08:10 AM

Quote:

Originally Posted by Brains (Post 5949167)
My favorite is Rufus, but only runs on Windows. You can try etcher, not sure if it's free.

Etcher is indeed free.


All times are GMT -5. The time now is 02:38 PM.