Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. Debian installer on a USB key with a writable file system.
  2.  
  3. I couldn't find a concise article about creating a Debian installer USB
  4. key with a writable file system, so here is my take. This assumes you
  5. have an available Linux system. Note that some old BIOSes might not
  6. happily boot USB drives created in this way.
  7.  
  8. * Install the packages syslinux extlinux dosfstools mbr
  9. * Insert the thumb drive and find the device using dmesg
  10. * Install a Master Boot Record to the drive (install-mbr /dev/sdX)
  11. * Create a DOS filesystem (mkdosfs /dev/sdX1)
  12.  
  13. Now mount the drive.
  14.  
  15. Add the initial ramdisk image and kernel binary (initrd.gz and vmlinuz) from
  16. http://http.us.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/initrd.gz
  17. http://http.us.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/vmlinuz
  18.  
  19. Add a Debian installation ISO. This may be netinst, a CD, DVD, or BD.
  20. For a BD, you will need to repartition and reformat[1] the thumb
  21. drive for ext4fs or some other Linux filesystem. This is because a
  22. FAT32 filesystem cannot handle files larger than 4 GB.
  23.  
  24. Create a text file on the drive named "syslinux.cfg". At a bare
  25. minimum, it should contain a single line:
  26.  
  27. default vmlinuz initrd=initrd.gz
  28.  
  29. Here's the new and "proper" way to do it:
  30.  
  31. DEFAULT BootUSB
  32. LABEL BootUSB
  33. KERNEL vmlinuz
  34. APPEND initrd=initrd.gz
  35. TIMEOUT 1
  36.  
  37. Automating the installation is very helpful and a big reason for why
  38. you'd want a writable installer thumb drive in the first place.
  39. This is the syslinux.cfg file you need to get that started:
  40.  
  41. DEFAULT BootUSB
  42. LABEL BootUSB
  43. KERNEL vmlinuz
  44. APPEND initrd=initrd.gz auto file=/hd-media/preseed.cfg locale=en_US console-keymaps-at/keymap=us
  45. TIMEOUT 1
  46.  
  47. Now dismount the drive and install syslinux on it (syslinux /dev/sdX1).
  48.  
  49. Remount the drive.
  50.  
  51. Now you'll need a file "preseed.cfg" placed in the root of the thumb
  52. drive. See http://www.debian.org/releases/stable/amd64/apb.html.en for
  53. more information.
  54.  
  55. Here's something basic:
  56.  
  57. d-i debian-installer/locale string en_US.UTF-8
  58. d-i keymap select us
  59. d-i keyboard-configuration/xkb-keymap select us
  60. d-i clock-setup/utc boolean true
  61. d-i time/zone string US/Pacific
  62. d-i clock-setup/ntp boolean true
  63. d-i passwd/user-default-groups string cdrom floppy sudo audio dip \
  64. video plugdev netdev scanner bluetooth vboxusers
  65. d-i partman/mount_style select traditional
  66. d-i mirror/country string US
  67. d-i mirror/http/hostname string http.us.debian.org
  68. d-i mirror/http/directory string /debian
  69. d-i popularity-contest/participate boolean false
  70. d-i apt-setup/use_mirror boolean true
  71. d-i pkgsel/include string build-essential devscripts flex bison gdb \
  72. autoconf automake cmake pkg-config libtool intltool-debian
  73.  
  74.  
  75. Footnotes
  76. =========
  77. [1]
  78. If you want to put a bluray ISO on your thumb drive, you'll need to
  79. repartition and reformat the drive for ext4fs or some other Linux
  80. filesystem. Run "sudo fdisk /dev/sdX", the delete all partitions. Make
  81. a new primary partition taking up the whole drive. Mark it type 83 for
  82. Linux. Mark it bootable. Type 'w' to write the partition info, then
  83. quit. Back to the command line, type "mkfs.ext4 /dev/sdX1". This
  84. formats the partition. Mount the drive. Type "extlinux --install
  85. /flash" or wherever you mounted the drive.
  86.  
  87. Sources
  88. =======
  89. http://hyper.to/blog/link/debian-installer-on-a-usb-key/
  90. https://www.debian.org/releases/stable/amd64/ch04s03.html.en
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement