On 05/27/2015 07:20 AM, Philip Hands wrote: > Charles Chambers <ccha...@gmail.com> writes: > >> Hi, Phil: >> >> And I've looked further. >> >> There's a step by step out there that describes the following steps: >> >> 1) Wipe USB drive. >> >> 2) Copy (via dd) boot.img to it. > I'm guessing that boot.img is an image of a VFAT file system, with > something like grub4dos on it (which supports booting ISO images from > the filesystem). > > That's a completely different thing from dd-ing the ISO itself. > > For it to work, the ISO needs to be able to find it's own image on any > old file system (which ours are built to do). > > If that floats your boat, fine.
The boot.img is extracted from boot.img.gz, which is found at, for example, here: http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/hd-media/ >> 3) Copy installation ISO (netinst in this case) to it via cp. The >> partition that gets the ISO *is* writeable at this point and beyond, >> which is progress. >> >> 4) Add preseed.cfg and whatever else in the space that's left >> (packages, firmware drivers, etc). >> >> 5) Boot and install. >> >> At this point I'm inspecting the USB after completing step 2. The >> partition scheme imposed by the dd of boot.img is: >> >> Disk /dev/sdb: 16.0 GB, 16008609792 bytes >> 64 heads, 32 sectors/track, 15267 cylinders, total 31266816 sectors >> Units = sectors of 1 * 512 = 512 bytes >> Sector size (logical/physical): 512 bytes / 512 bytes >> I/O size (minimum/optimal): 512 bytes / 512 bytes >> Disk identifier: 0x20ac7dda >> >> This doesn't look like a partition table >> Probably you selected the wrong device. >> >> Device Boot Start End Blocks Id System >> /dev/sdb1 ? 3224498923 3657370039 216435558+ 7 HPFS/NTFS/exFAT >> /dev/sdb2 ? 3272020941 5225480974 976730017 16 Hidden FAT16 >> /dev/sdb3 ? 0 0 0 6f Unknown >> /dev/sdb4 50200576 974536369 462167897 0 Empty >> >> Partition table entries are not in disk order >> >> ==================== >> >> Remounting the drive gives me this tidbit: >> >> /dev/sdb on /media/Debian Inst type vfat >> (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=utf8,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks) >> >> ==================== >> >> Notice the lack of a partition identifier ("/dev/sdb" instead of >> "/dev/sdb1"). >> >> I can copy the ISO to it. I haven't run an install, but I have a >> machine next to this one that's identical, so it should not be too >> difficult. >> >> The biggest questions I have with this approach: >> >> 1) The drive has 16g of space. How do I recover all 16g? >> >> 2) How did you add a partition after Step 3? My 16gig drive shows no >> space and four existing partitions, which is the limit. >> >> 3) Gparted and Kparted both show the USB as unallocated at the end of >> Step 2. Why? > Well, as I said above, you've just dumped a small VFAT file system on > the drive. > > You could resize it to get at the whole drive (to answer 1) ). Delete /dev/sdb2-4? > > I'm not sure that we look at the filesystem containing the ISO, when > it's been loop-mounted (as would be the case here, assuming it works) in > order to find a default preseed, but I guess that it's going to be > mounted on /hd-media, so if not at least you ought to be able to specify > it by it's path. > > As for question 3) well, you're copying (dd) a file system to the stick, and > then copying an ISO into that file system, so you get no partitions. Don't file systems exist only in partitions? The file system comes in when you dd boot.img, and it creates four partitions. On the fdisk output, I have accomplished step 2. Kparted and Gparted both agree at that same point that there are no partitions, but fdisk shows 4 partitions, thus none can be added. I'm assuming that the four partitions are embedded in boot.img and created as part of the dd operation. I was describing dd-ing the ISO directly to the stick. Our ISO images contain a partition table and boot loader as a bit of magic to make the stick bootable. It turns out that one seems to be able to add partitions, which is what I was on about. I can double check that, but IIRC I tried and could not. The remaining issue would be getting the new partition mounted, and the preseed.cfg therein used, preferably automatically. The objective is a unattended USB install with an edittable preseed.cfg, and optionally additional packages and firmware files included on the media. Windows does it with a customizable unattended.txt (I think) and a system integration tool to select the installation options.