Disk images
Gary W. Swearingen
garys at opusnet.com
Thu Apr 13 20:22:39 UTC 2006
Daniel Carrera <daniel.carrera at zmsl.com> writes:
> First, the use scenario:
> ------------------------
> An OEM wants to sell computers with Ubuntu Linux pre-installed. They setup one computer with Ubuntu's OEM
> installation. Then they make an image of that computer's disk and put it on many computers to sell.
[snip]
> 4) Next attempt: ??????? (suggestions?)
>
> I'm thinking that I might use fdisk to create the partitions. And perhaps use mke2fs too. But I still need a boot loader
> on the MBR. So one option is:
>
> * Use 'dd' to copy the bootloader.
Remember that the bootloader(s) are not all in the MBR.
> * Then use fdisk to create/fix the partitions.
>
> But this means that fdisk will have to fix a broken partition table. I don't know if that would work.
Seems problematical. And it sounds like you didn't give my previous
message enough attention. Maybe I was unclear.
> Another issue is that fdisk is an interactive program. I'd need a non-interactive counterpart so I can write a script
> that automates all of this.
I gather from a very quick look at the "parted" manpage that it can be
used non-interactively (instead of "fdisk") and can even be used to
create filesystems (though it mentions ext2 but not ext3).
Anyway, maybe try this:
Boot the "new" PC off some CD and run a script which does this:
1) zero first hd track, at least (probably unnecessary)
dd if=/dev/zero of=/dev/hda bs=16k count=1
2) partition the hd (with "parted")
3) make filesystem(s) (with "parted", "mkfs", or whatever)
4) connect to OEM server and "untar" files into filesystem(s).
5) Run bootloader creation software like grub or lilo.
6) Prompt installer to remove CD and reboot computer and run
"quality assurance" tests, etc.
The CD could be custom or an existing live CD plus a floppy with
the script or get the script after connecting to the OEM server, etc.
(You can even boot off the network if you want to go to the trouble
of setting it up and probably some change to the "new" PC, I forget.)
On a BSD OS, you'd avoid the historically problematical (and I suspect
slower) "tar" and use "dump" and "restore", which probably have Linux
versions, but tar should do the job.
You might be able to fit a copy of the tarball on the CD and avoid
the network bit. And make the script run at boot. Or use a second
CD.
I've never done this.
More information about the ubuntu-users
mailing list