Direct to a disk drive system installation.

If there is a computer with no input/output devices. One of the solutions is a direct software installation to its disk drive. And a subsequent configuration of the remote access with help of a virtual machine (QEMU).

The examples below are for Windows workstation against two target systems: x86 (Ubuntu) and ARM (Raspberry Pi).

1. Get a installation media with a operating system for the target computer. In this particular example: Ubuntu server iso file and Rapbian wheezy image;

2. Download and install QEMU;

3. Get out the disk drive from the server and/or SD card from the Rpi.

4. Connect the disk drive to your working station. (SATA to USB converter is needed or a SD card reader in Rpi case);
sata2usb

5. Prepare (format/erase) the disk drive (a console way):

6. Find out a disk device number (DeviceID):

wmic

7. Start QEMU and install the operating system.
Script for x86 Ubuntu:

Where “\\.\PHYSICALDRIVE1” is a path obtained on the previous step.
Script for Raspberry Pi:

8. Configure and check a remote control to the emulated target operating system.
e.g. Add this to the start script to test a ssh access through 10022 port:
-redir tcp:10022::22

9. Insert your disk drive in the target system. It will take some time to boot and to autotune all new hardware during the first start.

Run Windows 8.1 on a USB device.

To install Windows 8.1 on a USB device you’ll need:

a) >10 GB of free storage space;

b) >7 GB on the target USB device;

c) Same or higher Windows version to that you want to install (General case);

0. Firstly, WIMBoot file (install.wim or install.esd) file is needed. It can be found in the Windows 8.1 disk image that is available legally for free on Microsoft’s website. Just search for “Create installation media for Windows 8.1” ,then find “Create media” button. Launch the downloaded utility. Choose a desirable version and mark “ISO file” like shown bellow.Win2goISOChoose

Mount/Open/Unpack the downloaded ISO file. Install.esd file is located in the sources directory. (YourDiskImage\sources\install.esd). Copy it to any writable location (e.g your Desktop folder).

1. If you found install.ESD file, that’s just a compressed/encrypted version of WIM, download Converter.  Unzip and open it. Press big “Open” button, mark ESD -> WIM, choose the image in the dropbox. (usually 1).Win2goConv2. Prepare the USB device. Open “Control Panel\Administrative tools\Computer Management\Disk Management”. Find your device.  Create a PRIMARY, ACTIVE, formatted NTFS partition. (Caution! Any unconscious actions may damage/delete your data)Win2goPart3. The GImageX tool will be useful to install the previously obtained WIM file on the prepared USB device. Consider the image bellow as a example. Point on the file location at the first line and then, specify the drive letter of your USB device on second one.  Choose image index. (Commonly it’s 1). Apply.Win2GoApply4. Now, all is ready to copy boot records. The free version of EasyBCD utility will be helpful. Click on the “BCD Backup/Repair” button and choose a “Change boot drive” option. After it click on the “Perform action” button. WinBoot_BCDMenu

The dialog window will appear, where you should enter the letter of your USB device. WinBoot_BCDDriveIn reference to the EasyBCD documentation, this action performs not changing but copying of records.

6. Change your primary boot device setting in BIOS and you’re done.

 

Solving the USB-HDD “turns off” problem (particular case)

Recently, TS120GSJ18M had started to turn off on a high-load (data transfer). After several failed tries to copy large files (>4 GB) it had been disassembled and inspected:HDD_dis_1

Inside the case: The circuit-board based on the JM20335 LGAA1C chip (USB to PATA bridge) connected to the MK1231GAL drive (ZIF socket). HDD_dis_2

The board testing revealed no issues.HDD_dis_3
The assumption in a cable’s issue – the flexible flat cable was flipped upside down and the HDD works great now.

How to fix fake bad sectors (FAT32)

After using a chkdsk (check disk) in Windows 7 for the external USB HDD I obtained 0 free space. All 30Gb were gone.

Several repeatings of the procedure have done nothing, as well as fsck.vfat/msdos from Ubuntu LiveCD.  Acronis Disk Director didn’t recognize this USB HDD.

The last way is to fix it by using a hex editor:

1) Let’s find the MBR:

FATMBR

2) Next the first copy of FAT boot sector should be found. Here’s a description of the common part of the FAT12, FAT16 and FAT32 boot sectors:

Bytes| Content
0-2| Jump to bootstrap (E.g. eb 3c 90; on i86: JMP 003E NOP. One finds either eb xx 90, or e9 xx xx. The position of the bootstrap varies.)
3-10| OEM name/version (E.g. “IBM  3.3”, “IBM 20.0”, “MSDOS5.0”, “MSWIN4.0”. Various format utilities leave their own name, like “CH-FOR18”. Sometimes just garbage. Microsoft recommends “MSWIN4.1”.) /* BIOS Parameter Block starts here */
11-12| Number of bytes per sector (512) Must be one of 512, 1024, 2048, 4096.
13| Number of sectors per cluster (1) Must be one of 1, 2, 4, 8, 16, 32, 64, 128. A cluster should have at most 32768 bytes. In rare cases 65536 is OK.
14-15| Number of reserved sectors (1) FAT12 and FAT16 use 1. FAT32 uses 32.
16| Number of FAT copies (2)
17-18| Number of root directory entries (224) 0 for FAT32. 512 is recommended for FAT16.
19-20| Total number of sectors in the filesystem (2880) (in case the partition is not FAT32 and smaller than 32 MB)
21| Media descriptor type (f0: 1.4 MB floppy, f8: hard disk; see below)
22-23| Number of sectors per FAT (9) 0 for FAT32.
24-25| Number of sectors per track (12)
26-27| Number of heads (2, for a double-sided diskette)
28-29| Number of hidden sectors (0) Hidden sectors are sectors preceding the partition. /* BIOS Parameter Block ends here */
30-509| Bootstrap
510-511| Signature “55 aa”

FATBootSec

3) And finally, the first copy of File Allocation Table should start with Media Descriptor byte:

MediaDescByte

4) By replacing of all bad sectors (F7 FF FF 0F) with zeros the problem has been solved. (Replace only in the FIRST copy of FAT before the next Media Descriptor byte).

BadSec

Be care!

BadSecGone