Copying ISO to thumb drive using 'dd' causes thumb drive to be read-only?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.