I used dd to burn arch linux image to usb stick, but now I need to store additional files on the same usb stick. The usb stick is read-only after dd so I decided to format it manually. The stick was recognized as bootable but the arch failed to load the system since it was looking for a disk labeled "ARCH_201912". As far as I know I can use -n flag with mkfs.fat command like this:
mkfs.fat -F 32 -n "$label" "$partition"
I just do not want to type it manually as it changes every month (I am writing bash function). And dd somehow knows what the label should be and correctly set it to usb device. I thought there is a file storing this value, so I issued:
$ grep --directories=recurse ARCH_201912 .
./arch/boot/syslinux/archiso_pxe.cfg:APPEND archisobasedir=arch archisolabel=ARCH_201912 archiso_nbd_srv=${pxeserver}
./arch/boot/syslinux/archiso_sys.cfg:APPEND archisobasedir=arch archisolabel=ARCH_201912
Binary file ./EFI/archiso/efiboot.img matches
./loader/entries/archiso-x86_64.conf:options archisobasedir=arch archisolabel=ARCH_201912
Is there a way to get this label without parsing the file (as it seems that archisolabel is specific for arch linux)? I want this method work both for linux and windows. Though I am not sure if windows 10 require proper label set.
ddmethod and manual formatting. – Evgeniy Dec 22 '19 at 17:28ddalready do it for you. But I stated that I need extra files on the same media like installation guide.ddmarks drive as read-only, so I decided to manually format the drive and copy image files withcp. It works great due to EFI boot, but I have to manually set label which arch linux require. – Evgeniy Dec 22 '19 at 18:34ddknows nothing. If you are asked to copy a book and you're precise enough, you will be able to do this even if you don't know the language or the alphabet.ddjust copies bytes from one place to another. What you did probably could be done withcatorcp. These tools also know nothing. The label is there because it's inside the superblock of the filesystem or something. You can copy a book you cannot understand and if someone asks how did you know the main character's name, the answer will be mu. – Kamil Maciorowski Dec 22 '19 at 19:04ddable (like setting partitions or label)? This makes sense. I thought there could be kind of standard for EFI specifying label of the disk. – Evgeniy Dec 22 '19 at 19:55ddable? I don't understand. Every file is "ddable" because you can copy it. Not every file makes sane content for a USB pendrive though. I don't know EFI standards but if you copied the image to the entire device and it turned out some EFI partition appeared on it, then it means the partition table and the partition was inside the image. I'm not really sure what you did withdd(there is no exactddcommand in the question) and later (format it manually – how?), so I cannot replicate the problem. Alongside describing, post the actual commands you used. – Kamil Maciorowski Dec 22 '19 at 20:08ddable in terms of booting from usb. My question apparently cannot be answered as there is no file structure/layout I was looking for. I was looking only for label value stored in e.g. /boot/loader/label.txt or something easy to catch. – Evgeniy Dec 22 '19 at 20:31