Changes

From Amahi Wiki
Jump to: navigation, search
1,222 bytes added ,  02:07, 6 March 2015
=Foreward=
You cannot use a >=2.1TB partition as your boot device unless you have a UEFI bios. That is beyond the scope of this article.
 
When using a >=2.1TB partition, you should be running 64-bit Amahi.
 
Before you use a >=2.1TB drive on Windows, please read this support article: http://support.microsoft.com/kb/2581408
 
=Introduction=
As hard drives have increased in capacity over time, some clever workarounds have been engineered to keep breaking barriers, such as the move from CHS to LBA. Unfortunately, with older style MBR partitions, there is a limit of 2.1TB that simply cannot be worked around using an MBR partition. We have to instead use newer GPT style partitions.
=Warning=
BE ABSOLUTELY SURE THAT YOU ARE RUNNING THESE COMMANDS AGAINST THE CORRECT DRIVE. I WE CANNOT ACCEPT NO RESPONSIBILITY FOR ANY DATA LOSS , HARDWARE MALFUNCTION, ETC!
=OK, Let's do itParted usage=
First we label the drive with a GPT partition
{{Code| parted /dev/sdb mklabel gpt}}
Now we select sectors as a unit of measurement
{{Code| parted /dev/sdb unit s}}
Now we make the partition.
{{Code| parted /dev/sdb mkpart primary ext2 ext4 2048 -1}}
Parted may complain about the last sector and will automatically suggest a correct sector, just say Yes to the prompt.
We make it as a primary partition, ext2 ext4 filesystem, and we carefully select the sectors. The first number MUST be divisible by 8, so you can try 40, 48, 56, 64 etc... For me these numbers threw up errors, so I just went to 2048 and everything worked fine, and in the grand scheme of a 3TB drive, the extra sectors don't really matter :)
The reason that the starting sector is divisible by 8 is for aligning the sectors. This is because HDD's have traditionally been based around 512-byte sectors, yet newer, higher capacity HDD's are now arriving based around 4096-byte (a.k.a. 4k) sectors. The partitioning will still work with 512-bytes, but the drive's performance will be drastically impacted - in some testing it can be twice as slow, in others up to 25 times slower, depending on the sector alignment. So it's important to get this right!!!
=Alternative Parted usage=
Instead of the sequence of one liners up there, you can enter into parted itself like this. I give this as I don't know how your version of parted is going to behave. The interactive stuff from parted has been removed:
{{Code| parted /dev/sdb (parted) mklabel gpt (parted) unit s (parted) mkpart primary ext2 ext4 2048 -1 (parted) quit}}
=Format the drive!=
Finally, let's get that drive formatted to a nice ext4 volume:
{{Code| mkfs.ext4 -T largefile4 /dev/sdb1}}=Adding to your HDA=See [[Adding_a_second_hard_drive_to_your_HDA#Mount|mount the hard drive]].
=A note about Western Digital drives=
Create a bootable usb drive using [http://www.freedos.org/freedos/files/ FreeDOS] and [http://unetbootin.sourceforge.net/ unetbootin], then copy wdidle.exe onto the usb drive. Boot up your Amahi box to FreeDOS and enter the following commands:
{{Code| c:\ wdidle3 /R wdidle3 /S300}}
This cd's you to the usb drive's root, then we run wdidle3 /R to display the current drive status, then we run wdidle3 /S300 to set the park time to 5 minutes. Alternatively you could run wdidle3 /D to completely disable the parking.
n.b. Unetbootin was a bit finnicky for me, I found that if I created the drive with a FreeDOS live CD that it wouldn't work, but if I then re-created using unetbootin's automatic distribution download feature, the USB stick worked a treat. YMMV.
 
= 4TB Hard Drives =
If you have a new hard drive you can add it now. Here are some instructions to use for 4TB HDD using partedto make sure the alignment is right. Example here is with a new HDD that appears as /dev/sdb (read here: http://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/)
 
parted /dev/sdb
 
at the parted prompt
 
mklabel gpt
mkpart primary ext4 4096s 100%
align-check opt 1
quit
 
 
Formating the drive:
 
mkfs.ext4 -L greyhole01 /dev/sdb1
 
Mounting the drive:
 
hda-diskmount
 
Using the output from the above command, first backup /etc/fstab, and then add to /etc/fstab.
An example (and only an example!) of what needs to be added to /etc/fstab all on one line:
'''UUID=e68bc54a-b795-4ce0-802f-213f4ab71e60 /var/hda/files/drives/drive1 ext4 defaults 1 2'''
12,424

edits