[arch-releng] Help with hybrid ISOs and making extra partitions

Jim Pryor lists+arch-releng at jimpryor.net
Mon Mar 22 23:59:50 CET 2010


On Mon, 22 Mar 2010 19:32:39 -0300, "Gerardo Exequiel Pozzi"
<vmlinuz386 at yahoo.com.ar> said:

> 1) isohybrid write a MBR to first 512 of the .iso (LBA 0)
> 2) Inside this MBR there is one partition (is fake*) defined that is 
> type 0x17 (hidden NTFS) that points to LBA 0 (with offset 0) so points 
> to MBR (this is why called recursive), if offset 1 will point to LBA 1.
> 3) If you try to mount the partition with offset 1, you receive an 
> error, because there is no filesystem starting at that point. The only 
> real filesystem is at LBA 0 (UDF).
> 
> * is fake, because under this partition there is no real filesystem.
> 
> OK?
> 
> This is the "boot archiso" step (the key of the issue is at udev rule 
> 60-persistent-storage.rules)
> 
> supose sda is the USB key.
> 
> * offset 0 scenario:
> 1) udev process sda -> blkid is execute and get some attributes, in 
> these attr there is a LABEL, and set in udev database.
> 1a) /dev/disk/by-label/ARCH_201003 -> /dev/sda
> 2) udev process sda1 -> blkid is execute and.... (same above)
> 2a) /dev/disk/by-label/ARCH_201003 -> /dev/sda1
> 
> right, there is no problem here, because sda1 points to UDF filesystem
> 
> * offset 1 scenario:
> 1) udev process sda -> blkid is execute and get some attributes, in 
> these attr there is a LABEL, and set in udev database.
> 1a) /dev/disk/by-label/ARCH_201003 -> /dev/sda
> 2) udev procces sda1 -> blkid is execute but FAILS, attributes are 
> ihnerited from parent device (sda).
> 2a) /dev/disk/by-label/ARCH_201003 -> /dev/sda1
> 
> bad, there is no filesystem at sda1
> 
> so, why label for all filesystem? because the last unlabeled filesystem 
> will point to parent device (the attributed is inherited from parent
> device)
> 
> is more clear now?
> 
> More info about udev rules here:
> http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000900.html

Thanks, these details are helpful. So let me clarify/confirm:

1. If one's ever in a situation where one needs to supply a filesystem
type to mount the sda1 partition, one should use "udf", correct?
(Sometimes mount was asking me for a filesystem type, other times it
recognized it automatically. I'm not sure how often this will be needed,
but just to get clear about what to say when it is.)

2. We don't need to do anything to adjust the label of the sda1
partition; this will be taken from the ISO header. We only need to make
sure that every additional filesystem we put onto the device has a
label. If we fail to do that, then attempts to mount e.g. sda4 if that
contains the last unlabeled filesystem will really mount sda1.

3. Does the device really have a MBR? (I think the answer is Yes, "MBR"
just refers to a part of the device.)

4. Does the device really have a partition table? (I think the answer is
no, although somehow you're still able to create partitions, for example
with fdisk. That's what people seem to be saying. Have I understood
correctly?)

5. Does partition 1 have a filesystem? (You said the answer is no,
instead there's a UDF filesystem overlaying the region consisting of
both the MBR and partition 1, is that right?)

6. Do additional partitions sda2, sda3, ... we create on the device have
real filesystems? (I think the answer is yes, of course they do.)

-- 
Jim Pryor
jim at jimpryor.net



More information about the arch-releng mailing list