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.
dd
method and manual formatting.dd
already do it for you. But I stated that I need extra files on the same media like installation guide.dd
marks 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.dd
knows 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.dd
just copies bytes from one place to another. What you did probably could be done withcat
orcp
. 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.