Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Ubuntu Server

You're reading from   Mastering Ubuntu Server Upgrade your Ubuntu skills

Arrow left icon
Product type Paperback
Published in Jul 2016
Publisher
ISBN-13 9781785284526
Length 430 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Jay LaCroix Jay LaCroix
Author Profile Icon Jay LaCroix
Jay LaCroix
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Deploying Ubuntu Server FREE CHAPTER 2. Managing Users 3. Managing Storage Volumes 4. Connecting to Networks 5. Managing Software Packages 6. Controlling and Monitoring Processes 7. Managing Your Ubuntu Server Network 8. Accessing and Sharing Files 9. Managing Databases 10. Serving Web Content 11. Virtualizing Hosts and Applications 12. Securing Your Server 13. Troubleshooting Ubuntu Servers 14. Preventing and Recovering from Disasters Index

Creating a bootable Ubuntu Server flash drive (Linux)

On Linux systems, we can use either ddrescue or dd to create our bootable media. In the case of ddrescue, you'll first need to install the package on your system. If your distribution is Debian-based, you should be able to install it with the following command:

# apt-get install gddrescue

If your distribution is not Debian-based, use your distribution's package manager to install gddrescue. If this package is not available to you in your chosen platform, you can always fall back to the dd command, which I will also give you in this section.

With the gddrescue package installed, we can move on. Make sure the flash drive is inserted into your PC. Next, we'll need to run the following command in order to determine the name the system has provided for our flash drive:

# fdisk -l

From the output, you should be able to deduce which of the listed drives refers to your flash drive. In my case, /dev/sdc is mine. I know this because the partition /dev/sdc1 is formatted as FAT32, and I don't have any other partition formatted this way:

Creating a bootable Ubuntu Server flash drive (Linux)

Output from the fdisk -l command

If you are at all unsure which drive is which, you may consider executing the fdisk -l command before and after inserting your flash drive and comparing the results. For the remaining examples in this section, I will use /dev/sdc for the commands. However, please make sure that you change this to match however your flash drive is named. If you format the wrong drive, you'll lose data (or worse, end up with a PC that won't start the next time you turn it on). Pay careful attention here!

Now that we know the device name for our flash drive, we can begin creating our media. If you have ddrescue available to you, use the following command:

# ddrescue -d -D --force <path and file name of the ISO> /dev/<device name>

For example, in my case, the command is the following:

# ddrescue -d -D --force /home/user/downloads/ubuntu-16.04-server-amd64.iso /dev/sdc

Note

Be sure to replace /dev/sdc with the device name of your flash drive and the name of the ISO with the filename and path of the Ubuntu Server ISO you downloaded earlier.

With the example ddrescue command I provided, pay special attention to the fact that I did not identify a partition for the dd command. For example, I didn't use /dev/sdc1, I used simply /dev/sdc. This is important—the flash drive will not be bootable if you targeted a specific partition. After all, the ISO image is an image of an entire disk, not just a single partition.

As for the options I chose, I'm choosing direct disk access for input and output (the -d and -D flags), forcing our device to be overwritten (the --force flag), and using the full path and file name of our downloaded ISO and directing the output to /dev/sdc. Once you start the process, it shouldn't take very long to complete. When it's finished, you're ready to begin using it to install Ubuntu Server:

Creating a bootable Ubuntu Server flash drive (Linux)

ddrescue in the process of creating a bootable flash drive

For those of you without ddrescue available, you can use dd instead:

# dd if=/home/user/downloads/ubuntu-16.04-server-amd64.iso of=/dev/sdc bs=1M; sync

Similar to the ddrescue command, in the example for dd I'm using the path and filename of the Ubuntu Server ISO image as the input file (if=) and directing the output file (of=) to be that of my flash drive (/dev/sdc) and a block size of 1 MB (bs=1M). Unlike ddrescue, we won't see any fancy output with dd, but the process should work just fine. Once finished, we'll be ready to plan our partition layout and get our installation started.

You have been reading a chapter from
Mastering Ubuntu Server
Published in: Jul 2016
Publisher:
ISBN-13: 9781785284526
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image