📜 ⬆️ ⬇️

How to install Debian Linux with USB flash

In this article, you will learn how to create a USB flash drive from which to install Debian Linux.

Introduction


Here I will tell you how to prepare a bootable USB flash drive with Debian Lenny and install Debian from it on any drive (IDE / USB HDD). Note that this article does not describe how to install Debian on a USB disk / USB flash drive, but how to create an "Installation USB disk." That is, the result will be that you can install Debian Lenny from a USB drive instead of a traditional CD-ROM.

There are several ways to install Debian Lenny:

1. Using CD / DVDs that can be downloaded from the Debian website or ordered from many suppliers
2. Using a floppy disk
3. Using a USB-drive (keychain). That is what is described here.
4. Using network boot (PXE boot)
')
Method 1 is the most popular and simple.

Method 2 is outdated and very few people use it.

Methods 3 and 4 are not very clear, but Debian developers have done a lot of work to make them as simple as possible.

Step 1: Find a Linux computer and USB flash drive


You need a computer with Linux already running and a USB flash drive of at least 256 MB in size, which we will prepare as an installation disk.

Step 2: Connect the USB flash drive to the computer


Connect your USB drive to a computer running Linux and make sure it is defined by the Linux kernel. Most kernels in modern Linux distributions can detect USB devices on the fly and do not require something specific. You can verify that the USB device is detected or undefined with the following command:

# dmesg

and you will see something like this:

[373982.581725] sd 8:0:0:0: [sdc] 4001760 512-byte hardware sectors (2049 MB)
[373982.582718] sd 8:0:0:0: [sdc] Write Protect is off
[373982.582718] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[373982.582718] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[373982.584152] sd 8:0:0:0: [sdc] 4001760 512-byte hardware sectors (2049 MB)
[373982.585718] sd 8:0:0:0: [sdc] Write Protect is off
[373982.585718] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[373982.585718] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[373982.585718] sdc:
[373982.589280] sd 8:0:0:0: [sdc] Attached SCSI disk


Step 3: Download the boot image file for the USB device


Now download the boot.img.gz file from here.

Note: This image is for i386 architecture. You need to find an image for your architecture here . Under the “architecture”, the type of the system ON which you are going to install Debian Lenny is used.

For example, if you are going to install Debian on a computer with an AMD64 architecture, you need to go to the / installer-amd64 / directory and download the boot.img.gz file from there .

Step 4: Preparing the USB Disk for Boot


Note: At this step, all data from your USB drive will be deleted!

Now run the following command:

# zcat boot.img.gz > /dev/sdX

where sdX is the name of your USB device ( sdc in this manual). You can find out the name using the dmesg command (see step 2)

Now it's a good idea to pull out and plug in your USB flash drive so that the new structure / partition table is recognized by Linux. This will update the partition table stored by udev.

Verification: You can verify the success of this step by running the following commands:

# mount /dev/sdX /mnt/
# ls /mnt


and you should see installation files such as syslinux.cfg , setup.exe , and so on.

Note: There are no “1” or “2” suffixes, such as / dev / sdc1 or / dev / sdc2 . After you have copied the boot.img.gz image to the USB flash drive, there is no partition table on it, the file system is created right on the device itself.

Step 5: Download a netinstall or business CD image


So far, we have just prepared a USB flash drive for booting, but we still need an installation image to be used to install Debian. You have two options:

1. Download the ISO image of a netinstall size of 150-180MB from here . Netinstall installs the base system, no network needed.
2. Download a businesscard image about 40 MB in size from here . Network required for installation.

Step 6: Copy ISO Image to USB Disk


Now we need to do the last step - copy the previously downloaded (in the previous step) ISO image to the USB drive. To do this, run the following commands:

# mount /dev/sdX /mnt
# cp <path/to/iso/image> /mnt
# umount /dev/sdX


That's all. You have successfully created an installation USB disk, which can always be with you and used by you anywhere to install Debian Linux. Simply connect the USB drive to the computer on which you are going to install Debian Lenny and select the USB boot option in the BIOS. Now the CD-ROM does not trumpet at all!

Successful installation!

Sources


Installing Linux on USB - Part 7: Install Debian Linux from USB drives

My translation, some additions - too.

Source: https://habr.com/ru/post/53219/


All Articles