Debian U盘安装盘,debian安装盘


来源:Installing Debian Sarge from a USB memory stick (USB key)

updated:http://www.debian.org/releases/stable/i386/ch04s03.html.en

Copying the files - the easy way

There is an all-in-one file which contains all the installer files (including the kernel) as well as SYSLINUX and its configuration file. It resides in the hd-media subdirectory of the Debian installer images directory and is called boot.img.gz. You only have to extract it to the FAT partition on your USB stick:

    zcat boot.img.gz >/dev/sda1

Again, take care that you use the correct device name for your USB stick.

After that, mount the partition on your USB memory stick (mount /dev/sda1 /mnt) and copy a Debian netinst or businesscard ISO image to it (please note that the file name must end in .ISO).

Partitionless installation: Instead of /dev/sda1 you may also use /dev/sda as your target. This leaves your stick without a partition table so that it will contain only the file system. The advantage of this method is that you don't have to rely on the existing (and possibly buggy) master boot record (MBR) of your USB stick. But be aware that you won't be able to access your stick using some third-party operating systems.

Copying the files - the more flexible way

If you like more flexibility or just want to know what's going on, you should use the following method to put the files on your stick:

Unless you have already a FAT16 file system on your stick, use

    mkdosfs /dev/sda1

to create one. Take care that you use the correct device name for your USB stick. The mkdosfs command is contained in the dosfstools Debian package.

To put SYSLINUX onto the partition, install the syslinux and mtools packages on your system, and type

    syslinux /dev/sda1

Again, take care that you use the correct device name. The partition must not be mounted when starting SYSLINUX. This procedure writes a boot sector to the partition and creates the file ldlinux.sys which contains the boot loader code.

Note: Although the Debian syslinux package does not officially depend on mtools, it definitely needs mtools to write to the FAT file system.

Mount the USB memory stick (mount /dev/sda1 /mnt), choose a Debian installer subdirectory as explained above and copy the following files to the stick:

  • vmlinuz - the Debian installer kernel
  • initrd.gz - the initial ramdisk image
  • the SYSLINUX configuration file (see below)
  • optionally a Debian ISO image

If you want to rename the files, please note that SYSLINUX can only process DOS (8.3) file names.

The syslinux.cfg configuration file should contain the following two lines:

default vmlinuz
append initrd=initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw DEBCONF_PRIORITY=medium

The DEBCONF_PRIORITY=medium lets the installer ask some additional questions which might be useful, but you may of course leave this option out.

Now you may put any Debian ISO image (businesscard, netinst or even a full one) onto your stick (if it fits). The file name of such an image must end in ".iso". If you want to install over the network, you will of course skip this step.

Finally the directory listing of the USB stick could look somewhat like this:

drwxr-xr-x    2 root     root        16384 Jan  1  1970 .
drwxr-xr-x 25 root root 4096 Aug 6 23:03 ..
-rwxr-xr-x 1 root root 2554051 Nov 10 14:15 initrd.gz
-r-xr-xr-x 1 root root 7828 Nov 10 14:15 ldlinux.sys
-rwxr-xr-x 1 root root 117735424 Nov 10 14:16 netinst.iso
-rwxr-xr-x 1 root root 140 Nov 10 14:16 syslinux.cfg
-rwxr-xr-x 1 root root 769886 Nov 10 14:16 vmlinuz

When you are done, unmount the USB memory stick (umount /mnt) and activate its write protection switch.

ps. vmlinuz和initrd.gz与debian安装镜像的版本必须一致。

Copying the files - the easy way

There is an all-in-one file which contains all the installer files (including the kernel) as well as SYSLINUX and its configuration file. It resides in the hd-media subdirectory of the Debian installer images directory and is called boot.img.gz. You only have to extract it to the FAT partition on your USB stick:

    zcat boot.img.gz >/dev/sda1

Again, take care that you use the correct device name for your USB stick.

After that, mount the partition on your USB memory stick (mount /dev/sda1 /mnt) and copy a Debian netinst or businesscard ISO image to it (please note that the file name must end in .ISO).

Partitionless installation: Instead of /dev/sda1 you may also use /dev/sda as your target. This leaves your stick without a partition table so that it will contain only the file system. The advantage of this method is that you don't have to rely on the existing (and possibly buggy) master boot record (MBR) of your USB stick. But be aware that you won't be able to access your stick using some third-party operating systems.

Copying the files - the more flexible way

If you like more flexibility or just want to know what's going on, you should use the following method to put the files on your stick:

Unless you have already a FAT16 file system on your stick, use

    mkdosfs /dev/sda1

to create one. Take care that you use the correct device name for your USB stick. The mkdosfs command is contained in the dosfstools Debian package.

To put SYSLINUX onto the partition, install the syslinux and mtools packages on your system, and type

    syslinux /dev/sda1

Again, take care that you use the correct device name. The partition must not be mounted when starting SYSLINUX. This procedure writes a boot sector to the partition and creates the file ldlinux.sys which contains the boot loader code.

Note: Although the Debian syslinux package does not officially depend on mtools, it definitely needs mtools to write to the FAT file system.

Mount the USB memory stick (mount /dev/sda1 /mnt), choose a Debian installer subdirectory as explained above and copy the following files to the stick:

  • vmlinuz - the Debian installer kernel
  • initrd.gz - the initial ramdisk image
  • the SYSLINUX configuration file (see below)
  • optionally a Debian ISO image

If you want to rename the files, please note that SYSLINUX can only process DOS (8.3) file names.

The syslinux.cfg configuration file should contain the following two lines:

default vmlinuz
append initrd=initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw DEBCONF_PRIORITY=medium

The DEBCONF_PRIORITY=medium lets the installer ask some additional questions which might be useful, but you may of course leave this option out.

Now you may put any Debian ISO image (businesscard, netinst or even a full one) onto your stick (if it fits). The file name of such an image must end in ".iso". If you want to install over the network, you will of course skip this step.

Finally the directory listing of the USB stick could look somewhat like this:

drwxr-xr-x    2 root     root        16384 Jan  1  1970 .
drwxr-xr-x 25 root root 4096 Aug 6 23:03 ..
-rwxr-xr-x 1 root root 2554051 Nov 10 14:15 initrd.gz
-r-xr-xr-x 1 root root 7828 Nov 10 14:15 ldlinux.sys
-rwxr-xr-x 1 root root 117735424 Nov 10 14:16 netinst.iso
-rwxr-xr-x 1 root root 140 Nov 10 14:16 syslinux.cfg
-rwxr-xr-x 1 root root 769886 Nov 10 14:16 vmlinuz

When you are done, unmount the USB memory stick (umount /mnt) and activate its write protection switch.

相关内容

    暂无相关文章