0

I want to add files to my Debian setup USB flash drive and am trying to follow the steps from this answer: https://unix.stackexchange.com/a/559371

However, after successfully writing the image with dd bs=4M if=debian-11.0.0-amd64-netinst.iso of=/dev/sdb conv=fdatasync status=progress && sync, when I want to add the partition with fdisk and then b, I get the following error:

Command (m for help): b
There is no *BSD partition on /dev/sdb.

The device (null) does not contain BSD disklabel.

This is what the stick looks like:

$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 7,8 GiB, 8352956416 bytes, 16314368 sectors
Disk model: Flash Disk      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x31114a24

Device Boot Start End Sectors Size Id Type /dev/sdb1 * 0 6305695 6305696 3G 0 Empty /dev/sdb2 1476 6701 5226 2,6M ef EFI (FAT-12/16/32)

What does the error message mean? Where am I doing wrong? How can I add the partition instead?

finefoot
  • 3,060
  • What partition do you want to add, and why? dd:ing the iso to the USB stick does everything you need. conv=fdatasync is entirely redundant there as you call sync at the end anyway, and I'm not sure about that 4M blocksize - whether that works depends on the USB stick. dd bs=1M if=debian-11.0.0-amd64-netinst.iso of=/dev/sdb status=progress && sync should work just fine. – Peregrino69 Sep 12 '21 at 14:01
  • Yes, the second sync might be unnecessary, but it also doesn't hurt, right? ;) Also, I didn't have issues with bs=4M so far. The image itself works fine: booting and setup etc. But now I want to add files to it. As I understand the answer from the link above, I can add the new partition with b to make files available during Debian setup. It explicitly mentions dd in its first step, too. – finefoot Sep 12 '21 at 14:33
  • I actually said the first is redundant. KISS is the name of the game :-) I have a working Deb11 USB stick, so I checked. Same contents you have. Your "error" isn't one, it's an incomplete message, and it actually asks if you want to create a BSD Disklabel. Knowing how fdisk actually works I believe the OP in your linked instruction made a typo - command to create new partition is n, not b. I'm adding a comment on the linked instruction – Peregrino69 Sep 12 '21 at 14:49
  • Oh no. You're right. The b isn't a typo either: b W95 FAT32 It's the hex for the FAT32 type. Now I get it. I was so confused about the BSD disklabel error – finefoot Sep 12 '21 at 15:01
  • Thank you!! (And by the way, are you saying I can omit conv=fdatasync but not sync?) – finefoot Sep 12 '21 at 15:02
  • And do you want to write a short answer to this question so I can put the checkmark on it? – finefoot Sep 12 '21 at 15:04
  • Mate, you write the answer - you figured out, I've only managed to nudge you to the right direction :-D Answering your own questions isn't just allowed but actively encouraged. The linked instruction is confusing anyway so I'm leaving my comment there. And no, that's not it - conv=fdatasync is a dd internal option, while sync is an external utility. You don't need to use either, syncing is just generally recommended. Do drop another comment here if you get non-free drivers in use that way. I've had with Atheros during installations problems I've not been able to solve :-) – Peregrino69 Sep 12 '21 at 15:16

0 Answers0