Very Large Hard Drive

From hummy.tv Wiki
Revision as of 23:31, 1 February 2016 by Af123 (talk | contribs)
Jump to: navigation, search


Warning

Work in progress


This page is a work-in-progress describing the process necessary to install a very large hard drive into a Humax HDR Fox T2.


With the release of Custom Firmware 3.10 it is now possible to fit a Humax HDR Fox T2 with a hard drive having more than 2^32 sectors. In practice this means that drives over 2TB in size can now be used.

Drives known to work

The following very large drives have been tested and are known to work:

Vendor Model Size Physical Sector Size Logical Sector Size Description
Seagate ST4000VM000 4TB 4096 512 Video 3.5 HDD SATA

Pre-requisites

Using a very large drive requires Custom Firmware 3.10 or above. The stock Humax firmware cannot read these drives at all (it will see them but consider them to have a zero size).

Partitions tables

With these large drives, it is necessary to use a partitioning scheme called GUID Partition Table (GPT). When using a GPT, a legacy MBR containing a partition table is also created on the drive. This MBR generally contains a single partition of type EFI GPT (code 0xee) encompassing the entire drive, well as much of the drive as can be represented in an MBR partition - 2^32 sectors. This is known as a protective MBR since its main purposes is to prevent non-GPT-aware systems and tools from viewing the drive as empty or available. In the case of the Humax, it is necessary to create three partitions on the drive so that the Humax software sees these and considers the drive to be properly formatted.

Creating the GPT

Once the large disk is installed the gdisk command can be used to create the GPT. This command will also create a new protective MBR.

humax# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
 MBR: hybrid
 BSD: not present
 APM: not present
 GPT: not present

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Delete all partitions:

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Create the three required partitions:

Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-7814037134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-7814037134, default = 7814037134) or {+-}size{KMGTP}: +1G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Command (? for help): n
Partition number (2-128, default 2): 2
First sector (34-7814037134, default = 2099200) or {+-}size{KMGTP}:
Last sector (2099200-7814037134, default = 7814037134) or {+-}size{KMGTP}: -10G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Command (? for help): n
Partition number (3-128, default 3): 3
First sector (34-7814037134, default = 7793065984) or {+-}size{KMGTP}:
Last sector (7793065984-7814037134, default = 7814037134) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Which results in the following table (for a 4TB drive):

Command (? for help): p
Disk /dev/sda: 7814037168 sectors, 3.6 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): C4FC1347-AF56-4BCA-B918-623B08454E30
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2383 sectors (1.2 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         2099199   1024.0 MiB  8300  Linux filesystem
   2         2099200      7793065614   3.6 TiB     8300  Linux filesystem
   3      7793065984      7814037134   10.0 GiB    8300  Linux filesystem

Now write out the partition table:

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.

Creating the MBR Partition Table

First remove the protective partition that will have been created by the gdisk utility in the previous step:

humax# fdisk /dev/sda
fdisk: device has more than 2^32 sectors, can't use all of them

The number of cylinders for this disk is set to 266305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 2199.0 GB, 2199023255040 bytes
256 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1      266306  2147483647+ ee EFI GPT

Command (m for help): d
Selected partition 1

Then create the three dummy partitions for the Humax software to see:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-266305, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-266305, default 266305): +1G   

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (123-266305, default 123): Using default value 123
Last cylinder or +size or +sizeM or +sizeK (123-266305, default 266305): +1G

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (245-266305, default 245): Using default value 245
Last cylinder or +size or +sizeM or +sizeK (245-266305, default 266305): +1G

Resulting in the following partition table:

Command (m for help): p 
Disk /dev/sda: 2199.0 GB, 2199023255040 bytes
256 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1         122      983776+ 83 Linux
/dev/sda2             123         244      983808  83 Linux
/dev/sda3             245         366      983808  83 Linux

Change the type of the first partiton to EFI GPT:

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): ee
Changed system type of partition 1 to ee (EFI GPT)

Move the first sector of the first partition to 1:

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): x

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (0-1967615, default 63): 1
Recalculate C/H/S values? (Y/N): n

Expert command (m for help): r

The final MBR partition table looks like:

Command (m for help): p
 
Disk /dev/sda: 2199.0 GB, 2199023255040 bytes
256 heads, 63 sectors/track, 266305 cylinders, total 4294967295 sectors
Units = sectors of 1 * 512 = 512 bytes
 
   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1     1967615      983807+ ee EFI GPT
/dev/sda2         1967616     3935231      983808  83 Linux
/dev/sda3         3935232     5902847      983808  83 Linux

Write it to disk:

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table

Now restart the Humax using the remote control.

Formatting the file-systems

Once the Humax comes back, the filesystems must be formatted from the command line:

humax# mkfs.ext3 -m 0 -O sparse_super /dev/sda1
humax# mkfs.ext3 -m 0 -O sparse_super -T largefile /dev/sda2
humax# mkfs.ext3 -m 0 -O sparse_super /dev/sda3

Now reboot the Humax once more and everything should be set up.