Explanation
Your test.iso
contains an ISO 9660 filesystem. After dd
-ing, your USB drive contains a copy of the filesystem. ISO 9660 is intended for read-only media like CDs and it's by design read-only.
Your Linux can mount ISO 9660 from USB as if it was mounting a CD. There is even a way to mount from a regular file (i.e. you can mount the filesystem from test.iso
, we will get to this). ISO 9660 is read-only regardless of where it is mounted from.
In some cases we can write to a USB stick after dd
-ing an "iso" to it. This will happen if the "iso" contains a filesystem of another type, or a partition table and such filesystem(s). People tend to call any copy of a block device "iso", even if it contains something else than ISO 9660. They write their "isos" to USBs and there is no problem, so they (and you, I guess, until now) think any "iso" can be mounted for writing. Your file contains ISO 9660 though, it's a real iso, therefore read-only.
And what you did with dd
was just reading from test.iso
and writing to /dev/sdd
. There is no magic in dd
. You could do the same with cat
or cp
(more examples and some insight in this answer: Cloning an SSD with pv
command). There are few options in dd
that convert data (so the output is not identical to the input), but they surely cannot convert one filesystem type to another.
Solution
To create a modified ISO filesystem you need to work with genisoimage
. You don't want this, because a new ISO filesystem would still be read-only.
What you want to do is to create an empty filesystem on your USB. It should be of a type that is designed to be mounted for reading and writing: ext4, ext3, Btrfs, NTFS, FAT32, … Note filesystems have limitations. For Linux only, you should be good with ext4. To use the filesystem also with Windows, NTFS is a good idea. You should know what type of filesystem you want.
In case you no longer have /root/test/test.iso
, copy the files from the USB to another location because we are going to wipe the current content of the USB stick.
I assume /dev/sdd
is still your USB. Note this can change after reboot or after removing and inserting the USB, so you should not make this assumption automatically. Adjust all commands to your current situation and make sure you're working with the right device (lsblk
may be handy).
Unmount the USB (umount /dev/sdd
) before you proceed.
A standard procedure to create a filesystem on /dev/sdd
is like this:
- Use
wipefs -a /dev/sdd
to start from scratch.
- Create a partition table with one big partition (rather than a superfloppy) with
fdisk /dev/sdd
or gdisk /dev/sdd
, or a similar tool.
- Create a filesystem within the new partition (
/dev/sdd1
) with mkfs.<type>
(e.g. mkfs.ntfs
).
There are tools (often with GUI) that can do this all, e.g. gparted
or whatever disk management tool your distro uses.
Then you mount your USB somewhere, like you did when it contained the ISO 9660, but this time you will mount your new empty filesystem capable of being written to. You should also mount the ISO 9660 filesystem from test.iso
at another mountpoint (i.e. at some existing empty directory):
mount /root/test/test.iso /another/mountpoint
Finally you copy from /another/mountpoint
to your mounted USB. After that you umount /another/mountpoint
.
Or, if you no longer have /root/test/test.iso
, copy the files you have saved from the USB before wiping it. One way or another the files from test.iso
are now on your USB, inside a filesystem that you can write to.