linux:debian:automatic-installation
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:debian:automatic-installation [2013/06/18 06:59] – add Links stybla | linux:debian:automatic-installation [2013/06/25 05:06] (current) – finish up - foreword, conclusion and some other stuff stybla | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Debian - Automatic Installation ====== | ====== Debian - Automatic Installation ====== | ||
| - | <note warning> | + | ===== Foreword of sorts ===== | 
| + | |||
| + | As a pretty much any mainstream GNU/Linux distribution, | ||
| + | system installation. You can either use Preseed or a custom built ramdisk and use debootstrap | ||
| + | directly. | ||
| + | |||
| + | When I told my friend I'm looking into preseeding Debian he was like: // | ||
| + | The answer is there is nothing wrong with deboostrap and custom built ramdisk except it's a bit of work. | ||
| + | So why not to use Preseeding if it can do the job? | ||
| + | |||
| + | No doubt each approach has its pros and cons. I'm positive custom build ramdisk and deboostrap | ||
| + | will be faster than installer. Also, you can add tools you need, eg. tools for HW RAID, but you | ||
| + | can do a bit of scripting(and magic) as well, eg. assemble HW RAID prior to installation. Ramdisk can be used for | ||
| + | rescue and debugging. As a con I see maintenance - you have to create it, script(automate) it and keep it up-to-date. | ||
| + | |||
| + | Preseeding has pretty much the same capabilities. It allows you to install base Debian which is, in my opinion, | ||
| + | all you need and fine-tune the rest with Ansible/ | ||
| + | packages; support for LVM and Linux SW RAID; run additional commands; what have you. I'd almost forget you | ||
| + | can use Preseed for installation from USB/DVD/CD as well! And it's all maintained for you. | ||
| + | Now, here are some cons which, despite solveable, are a bit annoying. | ||
| + | |||
| + | ==== Cons of Debian Preseeding ==== | ||
| + | |||
| + | === Things don't always work out-of-the-box === | ||
| + | |||
| + | For example I didn't have much of success with network console. It just kept segfaulting on me at " | ||
| + | You might want to use different kernel, although replacing kernel should be the least warry and quite easy. | ||
| + | Something can be or get broken or there is going to be some sort of regression. | ||
| + | |||
| + | === More than one Preseed configuration might be necessary === | ||
| + | |||
| + | This might be due to the differences in hardware configuration. The thing is, you must specify target drive in case | ||
| + | there is more than one drive present. And I'm sure this isn't uncommon case. However, this can be solved by simple | ||
| + | CGI/script preseed generator which will return correct Preseed configuration file, eg. based on hostname. | ||
| + | |||
| + | === Missing tools === | ||
| + | |||
| + | I believe you could easilly add whatever you want and pretty much modify netboot ramdisk in way you like. | ||
| + | |||
| + | === MD5 sum of Preseed config must be kept up to date === | ||
| + | |||
| + | Yes, this is particularly annoying one. You can solve it in two ways. Don't use MD5 sum, however then you can't be sure | ||
| + | about integrity of preseed file you've just downloaded. Or just integrate it into your script you have for updating TFTP | ||
| + | boot configuration. I don't really think this is a hard one to do. | ||
| + | |||
| + | === Can't be used for rescue and/or debugging === | ||
| + | |||
| + | I'm not entirely sure this is true. I also think with a bit of work and modification it very well could be. | ||
| + | |||
| + | ===== Conclusion of sorts ===== | ||
| + | |||
| + | I find Debian Preseeding to be enough. It does basic Debian installation which is all I need, because after installation | ||
| + | is finished, I hand it over to Ansible/ | ||
| + | to install Debian via Installer, although I will look into custom built ramdisk sooner or later. More out of | ||
| + | curiosity rather than actual need, I guess. As I mentioned, not every time things work out-of-the-box. However, | ||
| + | the same can be said about everything and it's something you have to accept and be aware of - always. | ||
| ===== Customized ramdisk and debootstrap ===== | ===== Customized ramdisk and debootstrap ===== | ||
| Line 11: | Line 67: | ||
| Of course there are pros like having customized tool-set, " | Of course there are pros like having customized tool-set, " | ||
| and debugging, I guess more variability/ | and debugging, I guess more variability/ | ||
| + | |||
| + | Here comes an idea I haven' | ||
| + | a way it boots into shell instead of installer, add stuff you need want, remove stuff you don't need, | ||
| + | pack it, run with it. | ||
| ===== Preseeding ===== | ===== Preseeding ===== | ||
| + | |||
| + | ==== Requirements ==== | ||
| + | |||
| + | * TFTP, DHCP, web server | ||
| + |   * [[linux: | ||
| + | * time | ||
| + | * patience | ||
| + | |||
| ==== Example of preseed file ==== | ==== Example of preseed file ==== | ||
| + | |||
| + | I've removed pretty much all comments. What's below is my preseed file. | ||
| + | Please, see example preseed files/ | ||
| + | and, actually, more. | ||
| < | < | ||
| - | # Preseeding only locale sets language, country and locale. | + | ### l18n, i18n, keyboard | 
| d-i debian-installer/ | d-i debian-installer/ | ||
| - | # The values can also be preseeded individually for greater flexibility. | ||
| d-i debian-installer/ | d-i debian-installer/ | ||
| d-i debian-installer/ | d-i debian-installer/ | ||
| - | # Keyboard selection. | ||
| # keymap is an alias for keyboard-configuration/ | # keymap is an alias for keyboard-configuration/ | ||
| d-i keymap select us | d-i keymap select us | ||
| ### Network configuration | ### Network configuration | ||
| - | # netcfg will choose an interface that has link if possible. This makes it | + | # netcfg will choose an interface that has link if possible. | 
| - | # skip displaying a list if there is more than one interface. | + | |
| d-i netcfg/ | d-i netcfg/ | ||
| - | # If you have a slow dhcp server  | + | # In case of a slow dhcp server | 
| - | # it, this might be useful. | + | |
| d-i netcfg/ | d-i netcfg/ | ||
| - | # Any hostname and domain names assigned from dhcp take precedence over | + | # despite defined  | 
| - | # values set here. However, setting the values still prevents the questions | + | |
| - | # from being shown, even if values come from dhcp. | + | |
| d-i netcfg/ | d-i netcfg/ | ||
| d-i netcfg/ | d-i netcfg/ | ||
| - | # Disable that annoying WEP key dialog. | + | |
| d-i netcfg/ | d-i netcfg/ | ||
| - | # If non-free firmware  | + | # load non-free firmware without asking | 
| - | # configure the installer to always try to load it, without  | + | |
| - | # change to false to disable  | + | |
| d-i hw-detect/ | d-i hw-detect/ | ||
| Line 50: | Line 114: | ||
| d-i mirror/ | d-i mirror/ | ||
| d-i mirror/ | d-i mirror/ | ||
| - | d-i mirror/ | + | d-i mirror/ | 
| d-i mirror/ | d-i mirror/ | ||
| d-i mirror/ | d-i mirror/ | ||
| Line 62: | Line 126: | ||
| ### Clock and time zone setup | ### Clock and time zone setup | ||
| - | # Controls whether or not the hardware clock is set to UTC. | ||
| d-i clock-setup/ | d-i clock-setup/ | ||
| - | # You may set this to any valid setting for $TZ; see the contents of | ||
| - | # / | ||
| d-i time/zone string UTC | d-i time/zone string UTC | ||
| - | # Controls whether to use NTP to set the clock during the install | ||
| d-i clock-setup/ | d-i clock-setup/ | ||
| - | # NTP server to use. The default is almost always fine here. | ||
| d-i clock-setup/ | d-i clock-setup/ | ||
| ### Partitioning | ### Partitioning | ||
| - | ## Partitioning example | + | # this must be set in case you have more than one HDD present | 
| - | # If the system has free space you can choose to only partition that space. | + | d-i partman-auto/ | 
| - | # This is only honoured if partman-auto/ | + | # possible values: regular, lvm, crypto | 
| - | #d-i partman-auto/ | + | |
| - | + | ||
| - | # Alternatively,  | + | |
| - | # one disk the installer will default to using that, but otherwise the device | + | |
| - | # name must be given in traditional, | + | |
| - | # /dev/sda, and not e.g. / | + | |
| - | # For example, to use the first SCSI/SATA hard disk: | + | |
| - | #d-i partman-auto/ | + | |
| - | # In addition, you'll need to specify the method to use. | + | |
| - | # The presently available methods are: | + | |
| - | # - regular: use the usual partition types for your architecture | + | |
| - | # - lvm: use LVM to partition the disk | + | |
| - | # - crypto: use LVM within an encrypted partition | + | |
| d-i partman-auto/ | d-i partman-auto/ | ||
| - | # If one of the disks that are going to be automatically partitioned | + | |
| - | # contains an old LVM configuration, | + | |
| - | # warning. This can be preseeded away... | + | |
| d-i partman-lvm/ | d-i partman-lvm/ | ||
| - | # The same applies to pre-existing software RAID array: | ||
| d-i partman-md/ | d-i partman-md/ | ||
| - | # And the same goes for the confirmation to write the lvm partitions. | ||
| d-i partman-lvm/ | d-i partman-lvm/ | ||
| d-i partman-lvm/ | d-i partman-lvm/ | ||
| - | # You can choose one of the three predefined partitioning recipes: | + | |
| - | # - atomic: all files in one partition | + | # possible values  | 
| - | # - home:    | + | |
| - | # - multi: separate /home, /usr, /var, and /tmp partitions | + | |
| d-i partman-auto/ | d-i partman-auto/ | ||
| - | # This makes partman automatically partition without confirmation, | + | |
| - | # that you told it what to do using one of the methods above. | + | |
| d-i partman-partitioning/ | d-i partman-partitioning/ | ||
| d-i partman/ | d-i partman/ | ||
| d-i partman/ | d-i partman/ | ||
| d-i partman/ | d-i partman/ | ||
| - | # This makes partman automatically partition without confirmation. | ||
| d-i partman-md/ | d-i partman-md/ | ||
| d-i partman-partitioning/ | d-i partman-partitioning/ | ||
| Line 130: | Line 168: | ||
| d-i grub-installer/ | d-i grub-installer/ | ||
| d-i grub-installer/ | d-i grub-installer/ | ||
| - | d-i grub-installer/ | ||
| ### Finishing up the installation | ### Finishing up the installation | ||
| # Avoid that last message about the install being complete. | # Avoid that last message about the install being complete. | ||
| d-i finish-install/ | d-i finish-install/ | ||
| - | # This will prevent the installer from ejecting the CD during the reboot, | + | # don't eject CD as there isn't any | 
| - | # which is useful in some situations. | + | |
| d-i cdrom-detect/ | d-i cdrom-detect/ | ||
| # Setup SSH keys for root; the last command to be run before reboot | # Setup SSH keys for root; the last command to be run before reboot | ||
| - | d-i preseed/ | + | d-i preseed/ | 
| </ | </ | ||
| Line 151: | Line 187: | ||
|   APPEND initrd=img/ |   APPEND initrd=img/ | ||
| auto \ | auto \ | ||
| - |     url=http:// | + |     url=http:// | 
| preseed-md5=299d7a67793464e7e1e013a79660b64e \ | preseed-md5=299d7a67793464e7e1e013a79660b64e \ | ||
| + | fb=false \ | ||
| locale=en_US \ | locale=en_US \ | ||
| language=en \ | language=en \ | ||
| Line 166: | Line 203: | ||
| network configuration is done. At least I guessed so. And this also was a bit of unpleasant surprise to | network configuration is done. At least I guessed so. And this also was a bit of unpleasant surprise to | ||
| me. May be I've missed something, but I'd try to retrieve preseed file before installer starts up. | me. May be I've missed something, but I'd try to retrieve preseed file before installer starts up. | ||
| + | However, Debian' | ||
| + | some of these, options. | ||
| * **auto** - turns on automatic installation | * **auto** - turns on automatic installation | ||
| * **url** - URL to preseed file | * **url** - URL to preseed file | ||
| * **preseed-md5** - MD5 checksum of preseed file | * **preseed-md5** - MD5 checksum of preseed file | ||
| + | * **fb** - whether installer should use Frame Buffer or not | ||
|   * **locale**, **language**, |   * **locale**, **language**, | ||
| * **interface** - choose the first interface with link up(perhaps not necessary and on by default) | * **interface** - choose the first interface with link up(perhaps not necessary and on by default) | ||
|   * **netcfg/ |   * **netcfg/ | ||
|   * **netcfg/ |   * **netcfg/ | ||
| + | |||
| + | Turning off Frame Buffer('' | ||
| + | However, turning Frame Buffer off means graphics in installer will go wonky from time to time even when running in SDL window. | ||
| + | |||
| + | |||
| + | ==== How to configure network-console, | ||
| + | |||
| + | < | ||
| + | ### Network console | ||
| + | # Use the following settings if you wish to make use of the network-console | ||
| + | # component for remote installation over SSH. This only makes sense if you | ||
| + | # intend to perform the remainder of the installation manually. | ||
| + | d-i anna/ | ||
| + | d-i network-console/ | ||
| + | #d-i network-console/ | ||
| + | #d-i network-console/ | ||
| + | </ | ||
| + | |||
| + | This happens before APT repository is configured. You're presented with instructions and I believe as long | ||
| + | as you don't click // | ||
| + | '' | ||
| + | manually, or switch into shell. | ||
| + | |||
| + | Note, however, network-console has segfaulted(Wheezy 7.1) on my on several occasions. The first was when | ||
| + | I attempted to get into shell and second when I've clicked // | ||
| + | via SSH when installation proceeded. | ||
| + | |||
| + | |||
| + | ==== When is '' | ||
| + | |||
| + | Before APT repository is configured. | ||
| + | |||
| + | |||
| + | ==== When is '' | ||
| + | |||
| + | Just before machine is about to be rebooted. However ''/ | ||
| Line 179: | Line 255: | ||
| It may, and probably will over the time, happen you'll be asked some unusual question during installation.  | It may, and probably will over the time, happen you'll be asked some unusual question during installation.  | ||
| - | What you should do depends whether system boots after installation is finished.  | + | What you should do depends whether system boots after installation is finished. I've encountered quite weird | 
| - | quite weird and unusual GRUB problem when I updated Debian Wheezy  | + | problem  | 
| - | to solve it, simply because of lack of time, and I' | + | Wheezy  | 
| - | problem isn't in preseed  | + | it can happen - something gets changed or doesn' | 
| + | there is nothing wrong with Preseed  | ||
| - | Ok, that was one variant - fall back to the last known working configuration.  | + | Falling  | 
| is finished, you can run the following command and " | is finished, you can run the following command and " | ||
| - | your preseed file. Don't forget to update checksum of preseed file! | + | your preseed file. No worries, there are comments to ease the search. Don't forget to update checksum of preseed file! | 
| < | < | ||
linux/debian/automatic-installation.1371556767.txt.gz · Last modified:  by stybla
                
                