edgecase
Author: StJohn Piano
Published: 2018-12-29
Datafeed Article 81
This article has been digitally signed by Edgecase Datafeed.
This article has been digitally signed by its author.
7584 words - 2409 lines - 61 pages





GOAL



Set up a cheap Linux computer that supports:
- GUI online communications (email, social media)
- GUI web browsing + use of web 2.0 applications
- OpenSSL, Firefox/Chrome, etc.

GUI = Graphical User Interface




CONTENTS



- Goal
- Contents
- Brief Summary
- Summary
- Mac OS X Recipe For Writing A Bootable Operating System Image To A Flash Drive
- Notes
- Project Log




BRIEF SUMMARY



Note: None of the items used during this project were preserved as assets of this article.

I bought and set up a cheap Linux computer (£104.99), which I named "Shovel". I made a bootable CentOS 7.6 installation flash drive and used it to install CentOS 7.6 on Shovel.

Shovel successfully handled: email, social media, various web 2.0 applications, Firefox, and access to an external hard drive.

Shovel specifications: HP 6005 Pro SFF. 3 GHz x86_64 processor (AMD II x4 B95 Quad Core), 4 GB RAM, 1 TB hard drive. Running CentOS 7.6.1810 (Core).






SUMMARY



Note: None of the items used during this project were preserved as assets of this article.

I bought a new computer, which I named "Shovel". Price: £104.99 (inc Tax), £87.49 (exc Tax).

Shovel specifications: HP 6005 Pro SFF. 3 GHz x86_64 processor (AMD II x4 B95 Quad Core), 4 GB RAM, 1 TB hard drive. Running CentOS 7.6.1810 (Core).

I downloaded the DVD ISO image for CentOS 7.6.1810. It was 4.3 GB.

Using Aineko, a Mac OS X system, I copied this image to a USB flash drive. I wrote a recipe for doing this operation, which can be found in the section Mac OS X Recipe For Writing A Bootable Operating System Image To A Flash Drive.

I unpacked and set up the new computer, with peripherals etc. It came with a DMS-59 male cable that split into two VGA female ends, allowing me to connect a screen via a VGA cable to the DMS-59 female port on Shovel. The female VGA port on Shovel itself did not work.

Peripherals for Shovel:
- Power cable
- DMS-59 male to 2* VGA female cable
- VGA cable
- Screen with a VGA port
- Screen power cable
- USB mouse
- USB keyboard

I booted into the BIOS and looked through the settings. I disabled Security / Network Service Boot and Advanced / Device Options / S5 Wake-on-LAN.

I tested various websites (including several Javascript-heavy ones) to see if they worked / rendered on the Firefox that came with Centos 7.6. I was able to log in to various web 2.0 applications (GMail, LinkedIn, Facebook). Video players on various sites often didn't work, but the Youtube one worked fine. The successful logins imply that OpenSSL works as expected.

I checked whether various tools were installed:
- rsync 3.1.2
- gpg 2.0.22
- python 2.7.5
- openssl 1.0.2k-fips

Not installed:
- python 3

I plugged in an external hard drive (named "TRAVEL_1"), which did not auto-mount. After some effort, I was able to install a package that allowed Shovel to read the format (exFAT) of the filesystem on the external hard drive. The OS was then able to auto-mount the drive at
/run/media/spiano/TRAVEL_1
. No icon appeared on the Desktop, but in the File Browser, "TRAVEL_1" now appeared on the left-hand side in the Places list.

I was able to write a text file (containing the string "hello") to the external hard drive, unplug it, reconnect it, and read the text file again. This demonstrated that I could write to the drive as well as read from it.




Notes section:


The Notes section contains the following parts:

- Definitions and acronyms
- Services used during this project
- Computers used during this project
- Device names in Linux








MAC OS X RECIPE FOR WRITING A BOOTABLE OPERATING SYSTEM IMAGE TO A FLASH DRIVE



Note: This recipe was tested on a 2008 Macbook running Mac OS X 10.6.8 Snow Leopard. It has been somewhat rewritten after being tested.


-1) Make backups of the data on the computer that you are using.


0) Acquire the OS image (a single ISO file).

Example:
CentOS-7-x86_64-DVD-1810.iso

Original description of this example ISO:
"This DVD image contains all the packages that can be installed using the installer. This is the recommended image for most users."


1) Acquire a USB flash drive. It must have enough space to contain the OS image.


2) Insert the flash drive and wait for it to auto-mount.


WARNING: If you make a mistake in the next step you could wipe your operating system.



3) Format the flash drive as a single FAT32 partition. Partition scheme = Master Boot Record. Be careful not to format any other drive e.g. the main internal hard drive that contains the operating system.

On Mac OS X, you can use Disk Utility to do this. You can also use Disk Utility to name the device e.g. "CENTOS7_DVD".


4) Eject and unplug the flash drive.


5) Open a terminal. Change directory to the directory containing the OS image.

Example command:
cd ~/Downloads



6) Run the following command:

df -h


Example output:
aineko:Downloads stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 94Gi 22Gi 81% / devfs 110Ki 110Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled



7) Insert the flash drive and wait for it to auto-mount.


8) Run the following command:

df -h


Example output:
aineko:Downloads stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 94Gi 22Gi 81% / devfs 111Ki 111Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled /dev/disk1s1 7.4Gi 624Ki 7.4Gi 1% /Volumes/CENTOS7_DVD


In the output, find the filesystem that wasn't in the output of step (6).
In this example, it is "/dev/disk1s1".

I'll call this the "device partition path".

A partition is a block of space on a device.

A filesystem exists on a device partition. It is a structure for storing and accessing data (a database, in fact).

So: The string "/dev/disk1s1" is the path to the device partition that (in this case) contains a filesystem.


9) Run the following command, substituting the device partition path from step (8):

sudo diskutil unmount [device_partition_path]


Example:
sudo diskutil unmount /dev/disk1s1



10) Remove the "/dev/" prefix from the device partition path to get the device partition name.
Example: "/dev/disk1s1" becomes "disk1s1"


11) Get the partition name from the device partition name.

[Note: I'm not certain that the approach in this step always holds.]

The partition name is at the end of the device partition name. It consists of the character 's' and a number.

Example:
In the device partition name "disk1s1", the partition name is "s1".


12) Get the raw device name from the device partition name by deleting the partition name and adding the character 'r' to the front.
Example: "disk1s1" becomes "rdisk1"


WARNING: If you make a mistake in the next step you could wipe your operating system.



13) Run the following command, substituting the name of the ISO file from step (0) and the raw device name from step (12). Be careful not to make a mistake with the raw device name, lest you target a different device e.g. the main internal hard drive.

sudo dd bs=1m if=[ISO_file_name] of=/dev/[raw_device_name]


Example:
sudo dd bs=1m if=CentOS-7-x86_64-DVD-1810.iso of=/dev/rdisk1


If the OS image file is large, this may take a few minutes.

Example:
aineko:Downloads stjohnpiano$ sudo dd bs=1m if=CentOS-7-x86_64-DVD-1810.iso of=/dev/rdisk1

4376+0 records in
4376+0 records out
4588568576 bytes transferred in 943.580995 secs (4862930 bytes/sec)


943 seconds ~= 15 minutes.


14) Eject and unplug the flash drive.










NOTES





Parts


- Definitions and acronyms
- Services used during this project
- Computers used during this project
- Device names in Linux




Definitions and acronyms


CentOS = Community ENTerprise Operating System
DVD = Digital Video Disk (later: Digital Versatile Disk)
EPEL = Extra Packages for Enterprise Linux
exFAT = Extended FAT
FAT = File Allocation Table
GUI = Graphical User Interface
ISO = International Organization for Standardization
OS = Operating System
SSF = Small Form Factor
USB = Universal Serial Bus




Services used during this project


www.bargainhardware.co.uk
Sells configurable refurbished business computers.

pkgs.org
A search engine for RPM packages.

wiki.centos.org/Download
Provides details of CentOS releases and links to a list of mirrors that hold the ISO files for CentOS release.




Computers used during this project


Aineko specifications: Apple 2008 Macbook. 2.4 GHz x86_64 processor (Intel Core 2 Duo), 6 GB RAM, 126 GB hard drive. Running Mac OS X 10.6.8 Snow Leopard. Tools installed: Python 2.7.13.

Shovel specifications: HP 6005 Pro SFF. 3 GHz x86_64 processor (AMD II x4 B95 Quad Core), 4 GB RAM, 1 TB hard drive. Running CentOS 7.6.1810 (Core). Tools installed: Python 2.7.5.




Device names in Linux


The /dev directory is where the computer lists attached devices that it can "see".

superuser.com/questions/558156/what-does-dev-sda-for-linux-mean

On the linked page, the answer by Shadur indicates that:
- The "sd" prefix indicates any non-IDE block device (e.g. USB external hard drive, USB flash drive). It originally indicated a SCSI device.
- The computer discovers devices in a particular order. The letter immediately after "sd" indicates its place in this order: a, b, c ... z, Aa, Ab ... Az, ..., etc.
- The number after that signifies the partition on the device.

So:
- /dev/sda == the first device.
- /dev/sda1 == the first partition on the first device.
- /dev/sdb == the second device.
- /dev/sdb1 == the first partition on the second device.















PROJECT LOG



I'm going to buy a new computer.

Goal: Set up a new Linux computer that supports:
- GUI online communications (email, social media)
- GUI web browsing + use of web 2.0 applications
- OpenSSL, Chrome, etc.

GUI = Graphic User Interface

The computer should be relatively cheap and disposable.

I will name it Shovel.


I won't be seeking to preserve any digital assets involved. I'll buy the hardware and see which current Linux OS I can install successfully. I won't bother with a minimal installation + selecting packages.


My work computer: Aineko, a 2008 Macbook running Mac OS X 10.6.8 Snow Leopard, with Python 2.7.13 installed.

I'm using the Chrome web browser.



After looking at available computers on bargainhardware.co.uk, I chose the following computer base + configuration primarily for a) its cheapness [£104.99] (b) its satisfactory processor speed [3.00 GHz], memory size [4 GB], and hard drive size [1000 GB].
Notes:
- The expandable RAM (up to 16 GB) may be useful in future for handling e.g. bloated websites.
- Perhaps a higher-quality graphics card will be necessary for handling videos and Javascript-heavy sites.





www.bargainhardware.co.uk/hp-6005-pro-sff-a-grade-configure-to-order


==========


=== Name, weight, basic price


HP 6005 Pro SFF A Grade (Configure-To-Order)

Brand: HP
Availability: Usually ships in 48-72 Hours

Weight: 9.0 KGS
Shipping: Calculated at checkout
Price: £38.99 (inc Tax) £32.49 (exc Tax)



=== Description & Specification


Product Description:

The HP 6005 Pro is packed with high performance features, is energy efficient and is well equipped to go beyond meeting the daily business demands.

With our fully configurable hardware options you can custom build the HP 6005 Pro, taking advantage of the huge range of compatible components. The Quad CPU's deliver the multi-core processing power to run data intensive 64-bit applications and optimize the latest Windows 7 and 8 operating systems. The refurbished HP 6005 Pro is suited to any home or office environment with its action packed performance subtley housed in a quiet, compact small form factor chassis.

Business customers should accept nothing less than the best in reliability and performance. In this respect there are precious few alternatives to the HP enterprise class computers, of which the HP 6005 Pro sits at the top of the range.



Specification:

Processor (CPU):
- AMD II x4 B95 Quad Core 3.0GHz CPU

Memory (RAM):
- 4 x DIMM Slots - PC3-8500/10600 DDR3
- Maximum 16 GB (4 x 4GB)

Hard Disk Controller:
- On-Board Serial ATA (SATA) controller (with RAID 1)

Hard Disk Drive:
- 1 x 3.5" SATA Hard Drive (LFF) - (optional expansion to 2 hdd's)

Graphics:
- Integrated Intel Graphics Media Accelerator 4500
- 1 x PCI-Express x16 Slot (Low-Profile)

Audio:
- High Definition Audio with Realtek ALC261 codec (all ports are stereo)

Optical Drive:
- DVDRW, DVD, DVD/CDRW or CD-ROM drive in 1 x 5.25-inch bay

Network Ports:
- Intel 82567LM GbE Network Connection (integrated)

Power:
- 240W standard or 89% high efficiency Power Supply

Operating System License:
- Custom configured

Expansion Slots:
- 4 Half-Height (Low-Profile) slots:
-- 1 x PCI Express x16 slot
-- 2 x PCI Express x1 slot
-- 1 x PCI slots

Interface Ports:
- Front:
-- Headphone
-- Microphone
-- 2 x USB 2.0
- Rear:
-- 6 x USB 2.0
-- 1 x Serial port
-- 1 x VGA (Video)
-- 1 x DisplayPort (Video)
-- 2 x PS/2 keyboard and mouse
-- 1 x RJ-45 to integrated Gigabit LAN
-- 1 x audio In
-- 1 x audio Out



Physical Information:

Dimensions (WxDxH):
- 10.03 x 33.78 x 37.85 cm

Weight:
- 7.26Kg (Approx)



=== Configuration choices, their prices, and final price.


Processor:
- 3.00Ghz - AMD II x4 B95 Quad Core (Included in Price)

Memory:
- 4GB - (2 x 2GB) - DDR3 - 1066/1333Mhz +£14.00

Hard Drive:
- 1000GB - SATA II - 7200RPM +£40.00

Graphics Card:
- nVidia Quadro NVS290 - 256MB DDR2 - Dual VGA +£13.00

Operating System:
- No Operating System or COA +£0.00

WiFi Adapter:
- No USB Wi-Fi Adapter - Wireless N +£0.00

Keyboard and Mouse:
- No Keyboard or Mouse +£0.00

Price: £104.99 (inc Tax), £87.49 (exc Tax)


==========




First question: What is the processor architecture?

Processor (CPU):
- AMD II x4 B95 Quad Core 3.0GHz CPU

Main possibilities:
- i386
- x86_64

The description says that the CPU can handle 64-bit applications, suggesting the x86_64 architecture.


Google "AMD II x4 B95 architecture"

First result:
www.cpu-world.com/CPUs/K10/AMD-Phenom%20II%20X4%20B95%20-%20HDXB95WFK4DGI.html

Excerpt:
Family: AMD Phenom II X4
Model number: B95
Microarchitecture: K10



Google "k10 amd"

First result:
en.wikipedia.org/wiki/AMD_10h

Excerpt:
The AMD Family 10h, or K10, is a microprocessor microarchitecture by AMD based on the K8 microarchitecture.

[...]

Instruction set: AMD64 (x86-64)



Ok. I'll assume that its architecture is x86_64.



I'll use these two previous articles as guides for making an bootable USB flash drive and using it to install a Linux OS on Shovel.

Making a Centos 6.9 bootable USB memory stick on Mac OS X 10.6.8 Snow Leopard

Installing Centos 6.9 Minimal on Kalkin


I'll try the latest version of CentOS.


Browse to
wiki.centos.org/Download

Latest version:
- CentOS Linux Version: 7
- Minor release: 6 (1810)
- CD and DVD ISO Images: DVD, Minimal, Everything, LiveGNOME, LiveKDE and NetInstall x86_64 images are available on mirrors [ http://isoredirect.centos.org/centos/7/isos/x86_64/ ]

Excerpt:

Aside from the normal DVD and CD ISO images, the CentOS project occasionally releases special ISO images. Not all point releases get fresh spins of what is substantially unchanging content; if the latest and greatest refresh point spin does not have what you seek, you may wish to use the last version seen for a LiveCD or ServerCD, and as appropriate run updates in a post-install process:

- LiveCD - Bootable CD image with a working environment directly from CD
- ServerCD - Installable CD image with a limited package-set for server installations
- netinstall - Minimal CD image to start network installations (<10M)

The netinstall iso will only work with the corresponding point release, eg one cannot use the netinstall from CentOS Linux 6.2 to install CentOS Linux 6.3.





Browse to:
isoredirect.centos.org/centos/7/isos/x86_64

First mirror in list:
mirror.bytemark.co.uk/centos/7.6.1810/isos/x86_64


Excerpt:

0_README.txt
CentOS-7-x86_64-DVD-1810.iso
CentOS-7-x86_64-DVD-1810.torrent
CentOS-7-x86_64-Everything-1810.iso
CentOS-7-x86_64-Everything-1810.torrent
CentOS-7-x86_64-LiveGNOME-1810.iso
CentOS-7-x86_64-LiveGNOME-1810.torrent
CentOS-7-x86_64-LiveKDE-1810.iso
CentOS-7-x86_64-LiveKDE-1810.torrent
CentOS-7-x86_64-Minimal-1810.iso
CentOS-7-x86_64-Minimal-1810.torrent
CentOS-7-x86_64-NetInstall-1810.iso
CentOS-7-x86_64-NetInstall-1810.torrent
sha256sum.txt
sha256sum.txt.asc




I'm looking for the default Desktop-style option, to be installed via USB flash drive.


I'm not going to bother with checksums. This new computer is not meant to be particularly secure. Checksums don't protect you from compromised / malicious / incompetent code, and in the easy default version there will be plenty of that.





Right-click 0_README.txt and open it in a new browser tab.

Result:
mirror.bytemark.co.uk/centos/7.6.1810/isos/x86_64/0_README.txt

Contents:

List of images in this directory ================================ CentOS-7-x86_64-DVD-1810.iso This DVD image contains all the packages that can be installed using the installer. This is the recommended image for most users. CentOS-7-x86_64-NetInstall-1810.iso This is the network install and rescue image. The installer will ask from where it should fetch the packages to be installed. This image is most useful if you have a local mirror of CentOS packages. CentOS-7-x86_64-Everything-1810.iso This image contains the complete set of packages for CentOS Linux 7. It can be used for installing or populating a local mirror. This image needs a 16GB USB flash drive as it is too large for DVD isos. CentOS-7-x86_64-LiveGNOME-1810.iso CentOS-7-x86_64-LiveKDE-1810.iso These images are Live images of CentOS Linux 7. Depending on the name they use the respective display manager. They are designed for testing purposes and exploring the CentOS Linux 7 environment. They will not modify the content of your hard disk, unless you choose to install CentOS Linux 7 from within the Live environment. Please be advised that you can not change the set of installed packages in this case. This needs to be done within the installed system using 'yum'. CentOS-7-x86_64-Minimal-1810.iso The aim of this image is to install a very basic CentOS Linux 7 system, with the minimum of packages needed to have a functional system. Please burn this image onto a CD and boot your computer off it. A preselected set of packages will be installed on your system. Everything else needs to be installed using yum. The set of packages installed by this image is identical to the one installed when choosing the group named "Minimal" from the full DVD image. Using the installation images ============================= You can burn these images to a DVD or 'dd' them to a USB flash drive. After the boot media has been prepared, boot the computer off the boot media. If you do an install to your hard disk using these installation images, please remember to run "yum update" after the installation to update your system to the latest packages. Remember that in order to be able to partition your disk you will need to run the GUI installer which in turns needs enough RAM. The same is true for the network setup step. Please refer to the release notes available at http://wiki.centos.org/Manuals/ReleaseNotes/CentOS7 for more details about these aspects.




Ok. I'll go with "This is the recommended image for most users." i.e.
CentOS-7-x86_64-DVD-1810.iso
- listed size: 4.3G


I'll torrent it. Download the file
CentOS-7-x86_64-DVD-1810.torrent



Note that this is x86_64, the same architecture as the processor.



Torrent finished. The command
ls -lh
reports that the file is 4.3 GB.



The downloaded file is in my Downloads directory. I'll work there.




Excerpt from:
Installing Centos 6.9 Minimal on Kalkin

Next: Prepare the USB memory stick and write the minimal iso image to it.

I have an HP 16 GB stick.


I'll follow the recipe I used to make a Centos 6.9 bootable live USB memory stick, updated a little.


WARNING: Perform your backups now in order to avoid catastrophic data loss from making a mistake when using Disk Utility or when running the
dd
command.



Recipe for writing an OS iso image file to a memory stick:
- Format the USB memory stick as a single FAT32 partition. Partition scheme = Master Boot Record. On Mac OS X, use Disk Utility to do this.
- Remove the memory stick.
- In a terminal, change directory to the directory containing the OS image (e.g. CentOS-6.9-x86_64-minimal.iso)
- Run this command: $ df -h
- Reinsert the memory stick.
- Run this command: $ df -h
- In the output, find the item name that wasn't listed in the output from the first time that
df -h
was run. Example: /dev/disk1s1
- Remove the /dev/ prefix to get the device name. Example: /dev/disk1s1 becomes disk1s1
- Run this command: $ sudo diskutil unmount /dev/[device_name]
-- Example: $ sudo diskutil unmount /dev/disk1s1
- Get raw device name by deleting the partition name e.g. 's1' and adding 'r' to the front. Example: disk1s1 becomes rdisk1
- WARNING: If you make a mistake in the next step you could wipe your operating system.
- Run this command: $ sudo dd bs=1m if=CentOS-6.9-x86_64-minimal.iso of=/dev/[raw_device_name]
-- Example: $ sudo dd bs=1m if=CentOS-6.9-x86_64-minimal.iso of=/dev/rdisk1
-- This should take a few minutes.
- Remove the memory stick.



Insert memory stick. It mounts automatically and an icon appears on the Desktop.

Open Disk Utility (Version 11.5.2 (298.4)).

In Disk Utility, select the memory stick (it shows up as "15.96 GB hp v150w Media").

Click Erase tab.
- Format = MS-DOS (FAT)
- Name = CENTOS6_9_M
Click Erase.

Pop-up dialogue box opens with this message:
Are you sure you want to erase the disk "hp v150w Media"?
Erasing a disk deletes all data on all its partitions.
This disk is unformatted.

and two buttons: Cancel and Erase.
Click Erase.

Click Partition tab. Under Volume Scheme, choose 1 Partition. Click Options and choose Master Boot Record partition scheme.
Under Volume Information, set these values:
- Name = CENTOS6_9_M
- Format = MS-DOS (FAT)
- Size = 15.96
Click Apply.

Pop-up dialogue box opens with this message:
Are you sure you want to partition the disk "hp v150w Media"?
Partitioning this disk will delete all data on this disk.
This partition will be erased: "CENTOS6_9_M"
This partition will be added: "CENTOS6_9_M"

and two buttons: Cancel and Partition.
Click Partition.

Quit Disk Utility.

Eject CENTOS6_9_M disk (right-click icon on Desktop and choose Eject).

Remove the CENTOS6_9_M memory stick.


aineko:CentOS-6.9-x86_64-minimal stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 107Gi 10Gi 92% / devfs 109Ki 109Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled



Reinsert the CENTOS6_9_L memory stick. It mounts automatically and an icon appears on the Desktop.

aineko:CentOS-6.9-x86_64-minimal stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 107Gi 10Gi 92% / devfs 110Ki 110Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled /dev/disk1s1 15Gi 768Ki 15Gi 1% /Volumes/CENTOS6_9_M


Find the device name that wasn't listed before:
/dev/disk1s1


Unmount the disk:
aineko:CentOS-6.9-x86_64-minimal stjohnpiano$ diskutil unmount /dev/disk1s1

Volume CENTOS6_9_M on disk1s1 unmounted


Get raw device name by deleting the partition name e.g. 's1' and adding 'r' to the front. In this case,
disk1s1
becomes
rdisk1



WARNING: If you make a mistake in the next step you could wipe your operating system.



aineko:CentOS-6.9-x86_64-minimal stjohnpiano$ sudo dd bs=1m if=CentOS-6.9-x86_64-minimal.iso of=/dev/rdisk1

Password:
408+0 records in
408+0 records out
427819008 bytes transferred in 54.177718 secs (7896586 bytes/sec)



54 seconds / (60 seconds / minute) = 0.9 minutes


Remove and re-insert the memory stick.

Disk is auto-mounted as CentOS_6.9_Final.

Eject disk.

Remove memory stick.


Let's move from Aineko to Kalkin.

Insert memory stick into one of Kalkin's USB ports.

Press the power button to boot Kalkin.

After some startup messages, Kalkin arrives at a screen showing these options:

Welcome to CentOS 6.9!

- Install or upgrade an existing system
- Install system with basic video driver
- Rescue installed system
- Boot from local drive
- Memory test

Press [Tab] to edit options
Automatic boot in 60 seconds...

CentOS 6
Community ENTerprise Operating System


The option
Install or upgrade an existing system
was highlighted i.e. selected.

After 60 seconds the system booted, presumably using the first option.





Hm. Ok. This was for a Centos 6.9 Minimal image. Just copying it to the flash drive made it bootable. Or rather, the image was already designed to be bootable.


I have a SanDisk Cruzer Facet 8GB flash drive.


Perform backups now in order to avoid catastrophic data loss.

Done.



Let's write a proper recipe for copying an operating system image to a flash drive.






Mac OS X Recipe For Copying A Bootable Operating System Image To A Flash Drive


All steps developed & tested on a 2008 Macbook running Mac OS X 10.6.8 Snow Leopard.


-1) Make backups of information on the computer that you are using.

0) Acquire the bootable OS image (a single ISO file).

OS = Operating System
ISO = International Organization for Standardization

Example:
CentOS-6.9-x86_64-minimal.iso

1) Acquire a USB flash drive. It must have enough memory to contain the OS image.

2) Insert the flash drive and wait for it to auto-mount.

WARNING: If you make a mistake in the next step you could wipe your operating system.


3) Format the flash drive as a single FAT32 partition. Partition scheme = Master Boot Record.

On Mac OS X, you can use Disk Utility to do this.

4) Eject and unplug the flash drive.

5) Open a terminal. Change directory to the directory containing the OS image.

6) Run the following command:

df -h


7) Insert the flash drive and wait for it to auto-mount.

8) Run the following command:

df -h


In the output, find the item that wasn't in the output of step (5).
Example: "/dev/disk1s1"

Remove the "/dev/" prefix from the item path to get the device name.
Example: "/dev/disk1s1" becomes "disk1s1"

9) Run the following command, substituting the device name from step (7):

sudo diskutil unmount /dev/[device_name]


Example:
sudo diskutil unmount /dev/disk1s1


10) Extract the partition name from the device name.

[I'm not certain that the approach in this step always holds.]

The partition name is at the end of the device name. It consists of 's' + a number.

Example:
In the device name "disk1s1", the partition name is "s1".

11) Get the raw device name by deleting the partition name and adding 'r' to the front.
Example: "disk1s1" becomes "rdisk1"

WARNING: If you make a mistake in the next step you could wipe your operating system.


12) Run the following command, substituting the raw device name from step (10):

sudo dd bs=1m if=CentOS-6.9-x86_64-minimal.iso of=/dev/[raw_device_name]


Example:
sudo dd bs=1m if=CentOS-6.9-x86_64-minimal.iso of=/dev/rdisk1


If the OS image file is large, this may take a few minutes.

13) Eject and unplug the flash drive.







Ok. Let's run through the recipe.

Steps (-1) and (0) are complete.


2) Insert the flash drive and wait for it to auto-mount.

It doesn't auto-mount. Instead, I get this dialogue box:
{
The disk you inserted was not readable by this computer.
[Buttons:] Initialize..., Ignore, Eject
}

Hm. Evidently, it's strangely formatted. I probably used it in a previous project.

Click (Initialize...). Disk Utility opens.


3) Format the flash drive as a single FAT32 partition. Partition scheme = Master Boot Record.

In Disk Utility, select the memory stick (it shows up as "8 GB SanDisk Cruzer Facet Media").

Click Erase tab.
- Format = MS-DOS (FAT)
- Name = CENTOS7_DVD
Click Erase.

Dialogue box opens with this message:
{
Are you sure you want to erase the disk "SanDisk Cruzer Facet Media"?
Erasing a disk deletes all data on all its partitions.
This disk has 1 partition:
"disk1s2"
}
and two buttons: Cancel and Erase.
Click Erase.

Click Partition tab. Under Volume Scheme, choose 1 Partition. Click Options and choose Master Boot Record partition scheme.
Under Volume Information, set these values:
- Name = CENTOS7_DVD
- Format = MS-DOS (FAT)
- Size = 8.00
Click Apply.

[Note: There may have been another confirmatory dialogue box at this point. If so, I clicked through it unconsciously.]

Quit Disk Utility.



4) Eject and unplug the flash drive.

Done.



5) Open a terminal. Change directory to the directory containing the OS image.

Done. In this case, that directory is /Users/stjohnpiano/Downloads.



6) Run the following command:

df -h


aineko:Downloads stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 94Gi 22Gi 81% / devfs 110Ki 110Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled




7) Insert the flash drive and wait for it to auto-mount.

Done.



8) Run the following command:

df -h


In the output, find the item that wasn't in the output of step (5).
Example: "/dev/disk1s1"


aineko:Downloads stjohnpiano$ df -h

Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 117Gi 94Gi 22Gi 81% / devfs 111Ki 111Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk0s3 32Gi 14Gi 18Gi 45% /Volumes/Untitled /dev/disk1s1 7.4Gi 624Ki 7.4Gi 1% /Volumes/CENTOS7_DVD



The path of the new item is:
/dev/disk1s1

Remove the "/dev/" prefix from the item path to get the device name.
So, "/dev/disk1s1" becomes "disk1s1"

Ah. I see that this is specifically a new filesystem item, and I need its name.



9) Run the following command, substituting the device name from step (8):

sudo diskutil unmount /dev/[device_name]



aineko:Downloads stjohnpiano$ sudo diskutil unmount /dev/disk1s1

Password:
Volume CENTOS7_DVD on disk1s1 unmounted


Note: Password input not displayed.

Hm. Should really say "substituting the filesystem path from step (8)".



10) Extract the partition name from the device name.

[I'm not certain that the approach in this step always holds.]

The partition name is at the end of the device name. It consists of 's' + a number.



Ok. Device name is 'disk1s1'. Partition name here is 's1'.



11) Get the raw device name by deleting the partition name and adding 'r' to the front.

Device name = disk1s1
Raw device name = rdisk1



12) Run the following command, substituting the raw device name from step (11):

sudo dd bs=1m if=CentOS-7-x86_64-DVD-1810.iso of=/dev/rdisk1


Note the use of the Centos 7 image filename, not the Centos 6.9 image filename used in the examples.


aineko:Downloads stjohnpiano$ sudo dd bs=1m if=CentOS-7-x86_64-DVD-1810.iso of=/dev/rdisk1

4376+0 records in
4376+0 records out
4588568576 bytes transferred in 943.580995 secs (4862930 bytes/sec)


New dialogue box:
{
The disk you inserted was not readable by this computer.
[Buttons:] Initialize..., Ignore, Eject
}


Click Eject.


Hm. Wait. The same message again.

Insert flash drive. Click (Initialize...). Disk Utility opens. The disk has one partition, named "disk1s2", the same as before.

Possible explanation: The flash drive already had an image copied onto it.

In the linked previous project, reinsertion of the flash drive caused auto-mounting.

Let's try.


Insert flash drive into Aineko.

Result: New dialogue box:
{
The disk you inserted was not readable by this computer.
[Buttons:] Initialize..., Ignore, Eject
}


Hm. Maybe it's a difference between the Minimal and DVD Centos images.



943 seconds ~= 15.7 minutes.



Anyway. Proceed.




Unpack and set up the new computer, Shovel, with peripherals etc.

It came with two cables:
- a UK-plug power cable
- some type of splitter cable. It looks like two VGA female ends attached to a DVI-looking male end. On the included Sales Delivery Note, this is called a DMS59 (Male) to 2*VGA (Female) Cable.


Excerpt from:
en.wikipedia.org/wiki/DMS-59

DMS-59 (Dual Monitor Solution, 59 pins) is generally used for computer video cards. It provides two Digital Visual Interface (DVI) or Video Graphics Array (VGA) outputs in a single connector. An adapter cable is needed for conversion from DMS-59 (digital) to DVI (digital) or VGA (analog), and different types of adapter cables exist. The connector is four pins high and 15 pins wide, with a single pin missing from the bottom row, in a D-shaped shell, with thumbscrews.

The advantage of DMS-59 is its ability to support two high resolution displays, such as two DVI Single Link digital channels or two VGA analog channels, in a single DVI-size connector. The compact size lets a half-height card support two high resolution displays, and a full-height card (with two DMS-59 connectors) up to four high resolution displays.



The description matches the port + cable end that I see. The included picture also matches.


I don't see the DMS-59 port mentioned (as far as I can tell) in the original product description. Anyway, if it works, this should allow me to connect two screens to Shovel.


There is a separate VGA port, which I will use for now.


Peripherals for Shovel:
- Power cable
- VGA cable
- Screen with a VGA port
- Screen power cable
- USB mouse
- USB keyboard


Press the boot button. The computer boots and runs (it continues to make noise). Nothing displayed on screen.

Unplug the VGA cable from the VGA port. Plug it into the DMS59-to-2-VGA cable, and plug that cable into the DMS59 port on Shovel. The screen now displays some text.


Here is what the screen shows:

Hiren's BootCD 15.2 GRUBDOS0.4.5c20121002 638K/3578M 0

[option list]

- Boot from Hard Drive (Windows Vista/7/2008 or Xp)

- Mini Windows Xp
- Dos Programs
- Linux based rescue environment (Parted Magic 2012-10-10)

- Windows Memory Diagnostic
- MemTest86+
- Offline NT/2000/XP/Vista/7 Password Changer
- Kon-Boot
- Seagate DiscWizard (Powered by Acronis Trueimage)
- PLoP Boot Manager
- Smart Boot Manager 3.7.1
- Fix "NTDLR is Missing"
- Darik's Boot and Nuke (Hard Disk Eraser)
- Custom Menu... (Use HBCDCustomizer to add your files)
- More...

[end option list]



Press Down Arrow until option "More..." is reached. Some options, when highlighted, have an associated comment, which is displayed below the option list.

Result:

Hiren's BootCD 15.2 GRUBDOS0.4.5c20121002 638K/3578M 17

[option list]

- Dos Programs (Alternative Boot Method)
- Boot HDD 1 MBR
- Boot HDD 1 Partition 1
- Boot HDD 1 Partition 2
- Boot HDD 1 Partition 3
- Boot HDD 1 Partition 4
- Boot HDD 2 MBR
- Boot HDD 2 Partition 1
- Boot HDD 2 Partition 2
- Boot HDD 2 Partition 3
- Boot HDD 2 Partition 4
- Boot HDD 3 MBR
- Boot HDD 3 Partition 1
- Boot HDD 3 Partition 2
- Boot HDD 3 Partition 3
- Boot HDD 3 Partition 4
- More...

[end option list]



Press Down Arrow until option "More..." is reached.

Result:

Hiren's BootCD 15.2 GRUBDOS0.4.5c20121002 638K/3578M 34

[option list]

- Boot Windows XP (NTLDR) from Hard Drive
- Boot Windows Vista/7 (BOOTMGR) from Hard Drive
- Chainload isolinux.bin
- Reboot
- Shutdown
- Custom Menu... (Use HBCDCustomizer to add your files)
- ...Back
[end option list]



Press Down Arrow until option "...Back" is reached. Original, first result is displayed again.


The person who checked this computer probably left their testing bootCD in the drive.

Press the CD ejection button on Shovel. There's a CD inside with "H.B. V 15.2" written on it. Remove the CD. Press and hold the power button to turn Shovel off.


Press the power button to turn Shovel on.


The screen displays this result:

[blue background]
hp [logo]
invent

v01.11
<F9=Boot Menu> <F10=Setup> <F12=Network>



After a little time, this result changes slightly:

[blue background]
hp [logo]
invent

Press any key for Option ROM Messages

v01.11
<F9=Boot Menu> <F10=Setup> <F12=Network>



After a little time, Shovel attempts to boot. Screen now displays:

Attempting Boot From CD-ROM
Attempting Boot From Hard Drive
Attempting Boot From MBA v12.0.1 Slot 3F00 (PnP Device)

HP UNDI PXE-2.1 v12.0.1
Copyright (C) 2000,2009 Hewlett-Packard Development Company, L.P.
Copyright (C) 1997-2000 Intel Corporation
All rights reserved.

HP Base Code PXE-2.1 v1.1.1
Copyright (C) 2000,2009 Hewlett-Packard Development Company, L.P.
Copyright (C) 1997-2000 Intel Corporation
PXE-E61: Media test failure, check cable
PXE-M0F: Exiting HP PXE ROM.



Screen wipes and now displays:

Non-System disk or disk error
replace and strike any key when ready



Insert the flash drive into a USB port on the front of Shovel.


Press the Enter key.

Result:

Non-System disk or disk error
replace and strike any key when ready




Press and hold the power button to turn Shovel off.

Press the power button to turn Shovel on.


Result:

[blue background]
hp [logo]
invent

v01.11
<F9=Boot Menu> <F10=Setup> <F12=Network>



Result:

[blue background]
hp [logo]
invent

Press any key for Option ROM Messages

v01.11
<F9=Boot Menu> <F10=Setup> <F12=Network>



Result:

CentOS 7

[option list]
- Install CentOS 7
- Test this media & install CentOS 7

- TroubleShooting

[end option list]

Press Tab for full configuration options on menu items.

Automatic boot in 59 seconds...



The option
Test this media & install CentOS 7
is highlighted.

Press Enter key.

[lots of output here. takes about 5 minutes.]



Result (GUI): [not all detail included]

WELCOME TO CENTOS 7.

[option list]
- English
- Afrikaans
- ...
[end option list]

[option list]
- English (United States)
- English (United Kingdom)
- ...
[end option list]

[Buttons:] Quit, Continue


Choose English, English (United Kingdom), and click Continue.



Hm. I'm not going to record all the various Centos installation choices here.

I'll note down whatever I think is notable.


In the Installation Destination interface, I see:

Result: [not all detail included]
931.51 GiB
ATA WDC WD1002FBYS-0
sda / 1720.5 KiB free

[...]

Partitioning:
- [selected] Automatically configure partitioning.


This is approximately 1000 GB, i.e. the size of the hard drive chosen in the computer configuration.

Looks like the Centos installation system can see the hard drive without any problems and has automatically selected it as the installation destination.

Unlike in the previous project
Installing Centos 6.9 Minimal on Kalkin
there don't appear to be any issues with the format of the hard drive.


In the Software Selection interface, I have chosen:
- GNOME Desktop
with these add-ons:
- GNOME Applications: A set of commonly used GNOME Applications.
- Internet Applications: Email, chat, and video conferencing software.
- Legacy X Window System Compatibility: Compatibility programs for migration from or working with legacy X Window System environments.
- Office Suite and Productivity: A full-purpose office suite, and other productivity tools.
- Compatibility Libraries: Compability libraries for applications built on previous versions of CentOS Linux.
- Development Tools: A basic development environment.
- Security Tools: Security tools for integrity and trust verification.
- System Administration Tools: Utilities useful in system administration.

After clicking Done, there is a pause while software dependencies are checked.


Ok.

Click Begin Installation.

Messages:
- Root password is not set.
- No user will be created.

Each message is marked with a yellow exclamation mark. A note at the bottom of the screen says that this means that these items must be completed before the next step.

Clicking each message opens up a new interface for creating these settings.

Root password chosen. User "StJohn Piano (spiano)" will be created.



Looks like a total of 1547 packages are being installed.

[this took a while. perhaps 1 hour?]


End message:
{
CentOS is now succesfully installed and ready for you to use!
Go ahead and reboot to start using it!
[Button:] Reboot
}

Click Reboot.



Takes a while. Eventually reach configuration interface again. I have to accept the license arrangements (i.e. that CentOS takes no responsibility for what the software does or doesn't do) and then continue.

Next: I arrive at a login screen.

The username "StJohn Piano" is shown.

Log in with previously-chosen password.

Looks fine.



Connect Ethernet cable to Shovel.
- Have to go into Applications System Tools / Settings / Network to turn Wired connection to "On".

Start Firefox. Can browse Internet.


Shut down. Power on again. Still works.
- hm. can't browse Internet. Go to Applications System Tools / Settings / Network / Wired / [star] and tick "Connect automatically".





Using the previous article
Hardening the BIOS on Kalkin against remote access
as an example, check the BIOS settings and turn off anything really insecure (network boot, Intel Management Engine).

Press and hold the power button to turn Shovel off.

Press the power button to turn Shovel on. Hold F10 to enter Setup (in my experience, "Setup" means "BIOS configuration access").

I'm not going to record all the BIOS settings and information. I'll just make a note here of anything I change.

Security / Network Service Boot
- change to "Disable"

Advanced / Device Options / S5 Wake-on-LAN
- change to "Disable"

I can't see any Intel ME option.

Save settings and exit BIOS.

Shovel boots into Centos.




Let's test some websites.


- youtube.com works. can watch videos. Display resolution = 1920 x 1080. Youtube HD (1440p) video plays ok (slightly juddery, but watchable).
- www.rtve.es/directo/canal-24h does not work. video/audio doesn't play.
- stackoverflow.com is fine.
- news.ycombinator.com is fine.
- btcbase.org/log is fine.
- telegraph.co.uk is fine. video does not work (although, interestingly, video advertisement does).
- trilema.com is fine.
- twitter.com loads. video does not play.
- indeed.co.uk is fine.
- log into linkedin.com. works fine. video works.
- log into gmail.com. works fine. search works.
- log into facebook.com. works fine. video does not work.
- slashdot.org works fine.
- log into github.com. works fine. search works.




Open a terminal.


Running these commands:

rsync --version


gpg --version


python --version


shows me that these programs are installed and that their versions are:
- rsync 3.1.2
- gpg 2.0.22
- python 2.7.5


Running:

python3 --version


shows me that python3 is not installed.





Plug in an external hard drive. It does not auto-mount.



[mini-project occurs here]


After some effort, I have managed to mount the external hard drive, and read/write data to it.

I'll summarise:


[start summary]


I tried to follow:
Recipe for manually mounting a USB flash drive

Command:
sudo mount -o uid=spiano,gid=spiano /dev/sda1 /mnt/mount1


From looking at the data within device sda1, I think that it was a rescue partition of some kind on the internal hard drive.

The external hard drive was located at device sdb1.

The /dev directory is where the computer lists attached devices that it can "see".

superuser.com/questions/558156/what-does-dev-sda-for-linux-mean

On the linked page, the answer by Shadur indicates that:
- The "sd" prefix indicates any non-IDE block device (e.g. USB external hard drive, USB flash drive). It originally indicated a SCSI device.
- The computer discovers devices in a particular order. The letter immediately after "sd" indicates its place in this order: a, b, c ... z, Aa, Ab ... Az, ..., etc.
- The number after that signifies the partition on the device.

So:
- /dev/sda == the first device.
- /dev/sda1 == the first partition on the first device.
- /dev/sdb == the second device.
- /dev/sdb1 == the first partition on the second device.

When I tried this command:
sudo mount -o uid=spiano,gid=spiano /dev/sdb1 /mnt/mount1

this error was reported:
mount: unknown filesystem type 'exfat'


I searched on
pkgs.org
for "exfat". Among other results, I found:
exfat-utils-1.3.0-1.el7.x86_64.rpm [Utilities for exFAT file system].
This package was listed under a subheading called "CERT Forensics Tools x86_64", which turned out to be a particular Yum repo.
Some searching and reading indicated that this package would allow me to mount an exFAT-formatted drive.

The Yum package manager did not list this package as available.

Google "CERT Forensics Tools x86_64".

First result:
forensics.cert.org

I (roughly) followed the instructions at
forensics.cert.org/#centossupport

1. I used yum to install epel-release, a repo description package. epel = Extra Packages for Enterprise Linux.

2. I downloaded the CERT repo description package from
forensics.cert.org/cert-forensics-tools-release-el7.rpm

3. I used
yum localinstall
to install the CERT repo description package.

4. I downloaded the CERT public key from:
forensics.cert.org/forensics.asc

5. I used rpm to import the CERT public key and check the signature on the CERT repo description package. I should have done step 3 after this step. GPG version was 2.0.22.

6. Now, with my yum instance hooked to the EPEL and CERT repos, I was able to use the following command to download and install the exfat-utils package:
sudo yum install exfat-utils



Some output concerning dependencies and repos:

[spiano@localhost ~]$ yum deplist exfat-utils-1.3.0-1.el7.x86_64

Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirror.netweaver.uk * epel: epel.mirror.wearetriple.com * extras: mirrors.vooservers.com * updates: mirrors.vooservers.com package: exfat-utils.x86_64 1.3.0-1.el7 dependency: libc.so.6(GLIBC_2.4)(64bit) provider: glibc.x86_64 2.17-260.el7 dependency: libfuse.so.2()(64bit) provider: fuse-libs.x86_64 2.9.2-11.el7 dependency: libfuse.so.2(FUSE_2.6)(64bit) provider: fuse-libs.x86_64 2.9.2-11.el7 dependency: libpthread.so.0()(64bit) provider: glibc.x86_64 2.17-260.el7 dependency: libpthread.so.0(GLIBC_2.2.5)(64bit) provider: glibc.x86_64 2.17-260.el7 dependency: rtld(GNU_HASH) provider: glibc.x86_64 2.17-260.el7 provider: glibc.i686 2.17-260.el7


[spiano@localhost ~]$ ls -1 /etc/yum.repos.d/

CentOS-Base.repo
CentOS-CR.repo
CentOS-Debuginfo.repo
CentOS-fasttrack.repo
CentOS-Media.repo
CentOS-Sources.repo
CentOS-Vault.repo
cert-forensics-tools.repo
epel.repo
epel-testing.repo



Next: I was able to mount the hard drive.

[spiano@localhost ~]$ sudo mount -o uid=spiano,gid=spiano /dev/sdb1 /mnt/mount1

FUSE exfat 1.3.0


I later discovered that an auto-mount service was running. It mounted the external hard drive at another location:
/run/media/spiano/TRAVEL_1


TRAVEL_1 is the name I assigned to the hard drive when working on Aineko, a Mac OS X Macbook.

I think that once the exfat-utils package was installed, the auto-mount service (whatever it is) became able to mount the external hard drive, and did so. External devices can be mounted at two locations at once.

So: It was only necessary to install the exfat-utils package, not to try to manually mount and unmount the external hard drive.

I did not notice the auto-mount event - no icon was added to the Desktop (as occurs on Mac OS X). I later noticed that in the File Browser, "TRAVEL_1" now appeared on the left-hand side (in the Places list).

I was able to write a text file (containing the string "hello") to the external hard drive, unplug it, reconnect it, and read the text file again. This demonstrated that I could write to the drive as well as read from it.


[end summary]





[spiano@localhost ~]$ cat /etc/centos-release

CentOS Linux release 7.6.1810 (Core)

[spiano@localhost ~]$ openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017





Excellent. That's the end of this project.















[start of notes]



- I have not always preserved the format of any excerpts from webpages on other sites (e.g. not preserving the original bold/italic styles, changing the list structures, not preserving hyperlinks).
- I have not always preserved the format of any computer output (e.g. from running bash commands). Examples: Setting input lines in bold text, adding/removing newlines in order to make a sequence of commands easier to read, using hyphens for lists and sublists instead of indentation, breaking wide tables into consecutive sections.


[end of notes]