Linux make disk bootable

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Guide to create a bootable ssd/hdd with linux

S4mJ/Creating-a-bootable-linux-ssd-hdd

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This guide was created to help anyone who wants to create a bootable ssd or hdd with linux that is usable on any computer. I spent a long time researching how to do this as well as fixes for problems I encountered and this will walk you through the entire process. This guide uses the ubuntu operating system so commands may vary for other operating systems. This guide will also make the drive compatable with Apple computers.

This is the first step to making the bootable drive and requires you to have both the ssd/hdd you would like to use as well as a usb to save the ubuntu ISO to. Download the Ubuntu ISO to your system from https://ubuntu.com/download/desktop. It is ok to get the older version at this stage as it will be updated later anyway.

  • Insert both the usb and ssd into your ssd and open a terminal to execute the following commands.
  • These commands are for macOS specifically so you will need to look online for windows equivalents.
diskutil list diskutil eraseDisk FAT32 UBUNTU /dev/ diskutil unmountDisk /dev/

Setting up the partitions

This step will walk you through the process of installing linux onto the main ssd/hdd and setting up the partitions.

  • Power on your machine and repeatedly press the f12 button(could be another button depending on your motherboard manufacturer) until you come to a set of options in a boot menu.
  • You want to click the option that is for your USB. Look for a line names UEFI and double click it.
  • When a ubuntu menu appears click the first option to test out ubuntu first.
  • When you load in you should see a desktop with a series of applications on the left. Look for one called install Ubuntu and click it.
  • You need to go through this process up until you get to a page that will ask you what you want to install. Use the top option that is the reccommended install and you may optionally select any other options below it.
  • When you press continue after this there will be a short wait and you should then be brought to a menu regarding where you would like to install Ubuntu to. Make sure to only select the option at the bottom called «Something Else».
  • When you get to the next page you should see a series of drives most likely titled sda, sdb, sdc and so on. Find the one that is corresponding to your ssd/hdd and click it and then click create new partition.
  • You should be left with one unallocated of the size of your ssd.
  • Click this and press the small + sign at the bottom left to create your first partition.
  • The first partition you want to make is the swap partition. Set the size of the partition to be equal to the amount of ram your computer has.
  • Select the bottom two options of each section and finally select the partition format to swap area and then save.
  • The second partition you want to make is the main storage. Click the + again and leave all the settings as is except for the format which should be set to ext4 and the directory to /.
  • You then need to go to the bottom of that window and where you see a drop down menu of drives, select the USB that has the Ubuntu ISO loaded on. Then click install.
  • Continue on through these options untill you finish the installation and are instructed to reboot the system. When this happens again select the USB as the option to boot from and select the test ubuntu first option.

At this stage you have a functioning bootable ssd/hdd however at the moment you are only going to be able to use it on the system you created it on. This needs to be fixed.

  • Start by opening the terminal and running sudo fdisk -l to get a list of partitions.
  • Identify the one that has the linux partitions. In my case this is /dev/sdb. For the purposes of this guide we will call that /dev/sdX.
  • You also need to identify the partition that contains the root filesystem. In my case this is /dev/sdb2. We will refer to it as /dev/sdXY from now on.
  • Launch GParted from the terminal with sudo gparted /dev/sdX
  • From here you need to resize your main root partition to allow for 200mb more space elsewhere. Right click the root partition and select unmount. From there right click it again and click resize. Where you see the large number representing your size ssubtract 200 away from that number and click save. When you do this you should then see another new partition below it which is exactly 200mb in size. Createa new partition in that space and change the file system to fat32. Then click the apply operations button at the top of the window. After this applies, right click the new partition you just made and click manage flags. Set the flags to boot and esp. From now on I will refer to this partition /dev/sdXZ.
  • We now have a dedicated partition for the ESP however we need to make sure the ubuntu installation on the ssd/hdd can see it.
  • Launch Gparted from the terminal with sudo gparted /dev/sdX
  • Double click the linux root filesystem and write down the UUID so you can refer to it later.
  • Double click the new fat32 partition you just made and note down its UUID as well. This UUID should be much shorter than the previous one.
  • Close gparted and reopen the terminal.
  • Run the following commands
sudo umount /media/ubuntu/ sudo mount /dev/sdXY /mnt sudo nano /mnt/etc/fstab 
UUID= /boot/efi vfat defaults 0 1 
sudo mount /dev/sdXZ /mnt/boot/efi for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/$i; done sudo cp /etc/resolv.conf /mnt/etc/ modprobe efivars sudo chroot /mnt grub-install -d /usr/lib/grub/x86_64-efi --efi-directory=/boot/efi --removable /dev/sdX 

Even though the ssd/hdd will boot on any system, it will not yet be compatable with an apple computer. The solution to this is to update ubuntu to the latest version which will improve the system both from the updates and if you happen to be an apple user by allowing you to use it on an apple computer. Only do this if you are ok with not using the LTS version of linux or you want to use a apple computer.

The current version of ubuntu will be 18.04. We first need to upgrade this to 19.04 then finally to 19.10.

    Start by running the following commands

sudo apt update && sudo apt dist-upgrade sudo apt install update-manager-core sudo nano /etc/update-manager/release-upgrades 

You should now have a fully bootable version of linux usable on any system.

Источник

Create a bootable USB stick on Ubuntu

Creating a bootable Ubuntu USB stick is very simple, especially from Ubuntu itself, and we’re going to cover the process in the next few steps.

Alternatively, we also have tutorials to help you create a bootable USB stick from both Microsoft Windows and Apple macOS.

Laptop Ubuntu desktop

2. Requirements

  • A 4GB or larger USB stick/flash drive
  • Ubuntu Desktop 14.04 or later installed
  • An Ubuntu ISO file. See Get Ubuntu for download links

Download an Ubuntu ISO

3. Launch Startup Disk Creator

We’re going to use an application called ‘Startup Disk Creator’ to write the ISO image to your USB stick. This is installed by default on Ubuntu, and can be launched as follows:

  1. Insert your USB stick (select ‘Do nothing’ if prompted by Ubuntu)
  2. On Ubuntu 18.04 and later, use the bottom left icon to open ‘Show Applications’
  3. In older versions of Ubuntu, use the top left icon to open the dash
  4. Use the search field to look for Startup Disk Creator
  5. Select Startup Disk Creator from the results to launch the application

Search for Startup Disk Creator

4. ISO and USB selection

When launched, Startup Disk Creator will look for the ISO files in your Downloads folder, as well as any attached USB storage it can write to.

It’s likely that both your Ubuntu ISO and the correct USB device will have been detected and set as ‘Source disc image’ and ‘Disk to use’ in the application window. If not, use the ‘Other’ button to locate your ISO file and select the exact USB device you want to use from the list of devices.

Click Make Startup Disk to start the process.

Make USB device

5. Confirm USB device

Before making any permanent changes, you will be asked to confirm the USB device you’ve chosen is correct. This is important because any data currently stored on this device will be destroyed.

After confirming, the write process will start and a progress bar appears.

USB write progress

6. Installation complete

That’s it! You now have Ubuntu on a USB stick, bootable and ready to go.

If you want to install Ubuntu, take a look at our install Ubuntu desktop tutorial.

USB write complete

Finding help

If you get stuck, help is always at hand:

Источник

Читайте также:  Android до полноценного linux
Оцените статью
Adblock
detector