Hi,

Gene Heskett wrote:
> Wrote it to /dev/sdl, won't mount on sdl or sdl1. gparted says sdl2 is the
> dos partition??

The partition table of debian-12.6.0-arm64-DVD-1.iso is in MBR, which
many tools call "DOS".

  $ /sbin/fdisk -l debian-12.6.0-arm64-DVD-1.iso
  ...
  Disklabel type: dos
  ...
  Device                         Boot   Start     End Sectors  Size Id Type
  debian-12.6.0-arm64-DVD-1.iso1            0 7783551 7783552  3.7G 83 Linux
  debian-12.6.0-arm64-DVD-1.iso2      7783552 7798783   15232  7.4M ef EFI 
(FAT-12/16/32)

Partition 1 is the ISO 9660 filesystem.
Partition 2 is the EFI System Partition, a FAT filesystem.
Both and also the base device should be mountable after copying.

Try in a running Linux system

  dir=/mnt/iso
  sudo mount debian-12.6.0-arm64-DVD-1.iso "$dir"
  ls -l "$dir"

This should show
  total 653
  dr-xr-xr-x 1 root root   2048 Jun 29 12:24 EFI
  -r--r--r-- 1 root root   9084 Jun 29 13:39 README.html
  ...
  dr-xr-xr-x 1 root root   4096 Jun 29 12:24 pics
  dr-xr-xr-x 1 root root   2048 Jun 29 12:24 pool

The start of partition 1 and the start of the base device are the same.
So it makes no difference if you mount either of them.

Now for the EFI partition (7783552 * 512 = 3985178624):

  sudo umount "$dir"
  sudo mount -o offset=3985178624 debian-12.6.0-arm64-DVD-1.iso "$dir"
  find "$dir"

should show:

  /mnt/iso
  /mnt/iso/efi
  /mnt/iso/efi/boot
  /mnt/iso/efi/boot/bootaa64.efi
  /mnt/iso/efi/boot/grubaa64.efi
  /mnt/iso/efi/debian
  /mnt/iso/efi/debian/grub.cfg

Both mounts together will not work properly, because the kernel people
decided that one device needs only to be mounted once. Any further mount
just repeats the first one. Use losetup(8) to create separate /dev/loopN
if you really need these two mounts at the same time.

If Linux does not show these files by mounting /dev/sdl1 and /dev/sdl2
after copying the ISO to the SD card /dev/sdl, then copying went wrong or
the kernel did not notice the change of partition tables.
With a pluggable device it is best to unplug and replug.
A fixely installed drive may show the new table after:

  sudo hdparm -z /dev/sdl

(I wish we had a similar ioctl for size assessment of /dev/srX after
burning.)


> gene@coyote:~/Downloads/armbian$ sudo dd if=./debian-12.6.0-arm64-DVD-1.iso
> bs=4096 of=/dev/sdl1
> dd: error writing '/dev/sdl1': No space left on device
> its a 128GB card.

That's the wrong output device. You need to write ISOs with partitions
to the base device, not to an existing partition.
(I assume that sdl1 is smaller than the ISO.)

If the base device was partitioned by GPT, then you should also zeroize
the last block of the device. Else a partition editor could come to the
idea of restoring the GPT from the backup at the end of the device.
This would destroy the partition table of the ISO image.

Zeroizing the backup GPT header block would be done by xorriso-dd-target,
if you use that script for copying.
If the SD card is removable, then i propose
  
https://wiki.debian.org/XorrisoDdTarget#Identify_the_device_by_plugging_and_copy_if_it_looks_safe_enough

If plugging out-and-in is not an option or if xorriso-dd-target shys
away from overwriting the existing neither-ISO-nor-FAT filesystems, then
  
https://wiki.debian.org/XorrisoDdTarget#How_to_overwrite_a_drive_against_the_will_of_xorriso-dd-target
It will then show you the commands which it would run if it was more
daring.
(You could of course play with the other proposals in
  
https://manpages.debian.org/unstable/xorriso-dd-target/xorriso-dd-target.1.en.html
)


George at Clug wrote:
> If the aim is to make a bootable USB then I like to use:
> # cp debian-12.6.0-arm64-DVD-1.iso /dev/sdl

That should be ok.

> But I guess a micro-sd behaves differently to a USB ?

Not in the booted Linux. Maybe the firmware of the computer has its own
ideas. One could ask GRUB via its command shell how it perceives the
device persentation by the firmware. I roughly guess guess from "sdl":
  ls (hd12)
In general:
  ls
See
  https://www.gnu.org/software/grub/manual/grub/html_node/ls.html
(Experts might have better proposals for this.)


Gene Heskett wrote:
> -rw-r--r-- 1 gene gene 3993284608 Aug  3 19:39 debian-12.6.0-arm64-
> DVD-1.iso <-----trying to write this file to a new DVD+RW disk.
>
> XFburn claims it can't burn yet, so I had apt install k3b and its deps.
> I run k3b as me, you can see I own the iso so k3b should be able to write
> it, but k3b cannot see a single file in the above

If the DVD burner is /dev/sr0, try:

  xorriso -as cdrecord -v dev=/dev/sr0 -eject debian-12.6.0-arm64-DVD-1.iso

Linux will not show partitions on the burnt DVD.
But above mount commands should still yield above results:

  sudo mount /dev/sr0 "$dir"

  sudo umount "$dir"
  sudo mount -o offset=3985178624 /dev/sr0 "$dir"

Again, umount or separate /dev/loopN devices are needed if you do not
want to see both mount points bearing the same.


> So I need some sort of a magic spell.

I doubt that there is such a spell beyond properly copying the image to
the base device.


Gene Heskett wrote:
> > But I guess a micro-sd behaves differently to a USB ?

to...@tuxteam.de wrote:
> Not in this context. All your userspace sees is a block
> device. The kernel takes care of the rest.

But what is before the kernel gets started ?
First comes the firmware, then GRUB, and then Linux.
So there is still enough room for differences between USB stick and SD
card. It would be odd, of course.

Maybe the firmware thinks too much about ISO 9660 and El Torito.
Or maybe the firmware does not feel properly addressed by the MBR
partition table or by the EFI start program bootaa64.efi .

(If it was "armhf", then the EFI program would need to have the name
"bootarm.efi". The "armel" ISOs have no recognizable boot equipment.)


Have a nice day :)

Thomas

Reply via email to