Archive

Archive for the ‘Using Linux’ Category

Advanced Format Hard Drives

July 21st, 2011 6 comments

So as you all know I bought the 1.5TB WD drive from Scan and blogged about how to format it for your HDR T2… Well, after serveral months of working just fine in the PVR, it broke! :(

Thankfully, it was not the Humax that broke it, as I had to remove it and attach it to my Linux box, Windows PC, Apple Mac to verify that it was the drive that was the problem, and sure all reported it faulty (Linux refusing to even boot the system with it attached!)

I was gutted that all recordings had been lost, but the nightmare did not end there. Scan.co.uk, where I bought it from took an age to replace the drive. I also found out they sold me an OEM drive (I was not aware) as I went on the WD support site to return and found there was no warranty on it! When I first went through Scan’s return system, they wanted me to pay the postage to return the faulty drive to them, and finally when I was ready for a replacement, they could not replace it with the same drive but offered me the WD15EARS instead.

I don’t think I will buy from Scan.co.uk again, and I recommend that you shouldn’t either. This is not the first time I’ve had poor service from them but it will certainly be the last. Buy from a reputable online retailer who knows how to deal with customer returns and service.

Well, my misfortune is your advantage, as the WD15EARS is an Advanced Format Drive – you know the new HDD type with the 4K sectors… Read more here on Wikipedia.

What is the issue with AF Drives?
Initially when AF drives were released users discovered that there were performance issues with them on certain OS platforms – mainly Windows. You can read such articles about this from lots of places, here is one. They go on to explain about 4K sectors and how to align them for Windows use.

The question, when users here buy AF drives, is whether they will perform OK in a Humax PVR… Well, now I have a chance to answer!

Opening the WD15EARS and looking at the label it says:

Advanced Format Drive. To achieve full performance:

  • Windows XP, multi partition and cloning software users – use WD Align software available on www.wdc.com/advformat
  • Windows XP, single partition – set jumpers 7-8 prior to installation or use WD Align SW
  • All other OS configurations – drive is ready for use as is

So according to the label, using this HDD with the Humax PVR (we know it uses EXT3 filesystem) is to use it as is. We don’t need to do anything special to the drive like align the 4K sectors!

I did however, go onto the WD website to read what they say about using AF drives with Linux (EXT3), on this page. It says:

The Linux kernel has had specific support for the alternate sector sizes and offsets used by WD Advanced Format disk drives since version 2.6.31. However, distributions based on Linux 2.6.34, the latest stable version of Linux, will provide the most thorough support. Advanced Format parameters are available in the sysfs file system from this kernel version onwards. Kernel versions older than 2.6.31 will not specifically detect Advanced Format Drives, but with proper alignment the system performance will be maintained.

So it look like Linux is safe with AF drives if the kernel is v2.6.31 or later. Who knows what version Humax use for the HDR? So to be safe, I followed WD’s instructions to align the 4K sectors.

The Linux partition editor: parted, has an alignment option to ensure that Advanced Format drives are correctly configured from version 2.1:

-a alignment-type, –align alignment-type

valid alignment types are:

none Aligns to 512 byte sector boundaries.

cylinder Align partitions to cylinders.

minimal Use minimum alignment: 4KB on AF drives

optimal Use optimum alignment: 1MB boundaries

The default from parted 2.2 is to align to 1MB boundaries – optimal. Use minimal or optimal for Advanced Format drives. For example if your drive is sda:

parted -a optimal /dev/sda

will ensure that parted creates partitions on 1 MB boundaries.

So what I did was to partition the disk using the GParted Live CD as per blog instructions, cancelling the formatting of the large ‘recordings’ partition, and then used the command line parted on the GParted Live CD to format the partition ‘optimally’.

So with my WD15EARS, I created the 3 partitions needed the for the HDR, ‘onegb’, ‘restofdisk’ and ‘tengb’ using the graphics gparted (breaking out of formatting the restofdisk partition, and then opened a root terminal, and executed the parted command:

# parted -a optimal /dev/sdc
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

Where /dev/sdc should point to the HDD device you are working with.

Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkfs
WARNING: you are attempting to use parted to operate on (mkfs) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
Yes/No? y
Partition number? 1
File system type? [ext2]?
writing per-group metadata... 92% (time left 00:00)
(parted)

Repeat this for all 3 partitions. Note parted can only deal with EXT2, and the HDR need the partitions to be in EXT3. EXT2 is easily converted to EXT3 using the tune2fs command. So after the optimised format with parted, you need to run this command on all your 3 partitions:

# tune2fs -j /dev/sdc1 (onegb)
# tune2fs -j /dev/sdc2 (restofdisk)
# tune2fs -j /dev/sdc3 (tengb)

Well, I will insert this into my HDR FOX-T2 and see how it behaves…

GParted Live CD

May 21st, 2011 No comments

Sorry about not posting for a while. I’ve been meaning to make this post for a while now for completeness of the instructions on how to partition a drive for a HDR-FOX T2 or format a USB drive to use with the FOXSAT-HDR. Well here it is – the final part.

The two posts: here and here, talk about using Ubuntu and Slax. The former standing at 700MB, and 200MB or abouts, but the GParted Live CD is only 150MB in size. You can download it from GParted Live CD SourceForge site.

The GParted Live CD is the smallest to download and allows you to boot up your PC and run GParted to format your drive in the EXT3 filesystem that the Humax PVRs can understand. The small size of the Live CD image means that it is faster to download and run, but it less friendlier than the Ubuntu and Slax equivalent.

Although it is unfriendlier to use and looks slightly different, you would boot the Live CD and use GParted in exactly the same way as I’ve instructed in the respective posts.

GParted Live CD

Apart from the small download size, the GParted Live CD also has the correct version of the command-line parted which is used to format an Advanced Format hard disk drive to have the 4K blocks aligned – either optimally, or minimally, so that they work without performance issue with Linux.

Using Slax with GParted to format USB drive to EXT3

March 30th, 2011 6 comments

Although Ubuntu is highly rated and has GParted as standard on the its Live CD, it is 700MB or so to download, so if you are wanting a smaller download, then this GParted Slax Live CD (I’ve built) is for you!

Slax Live CD

Here’s my guide to formatting a USB drive to EXT3 using a Slax ISO I’ve built with the GParted disk utility. I believe that the latest Ubuntu Live CD (v10.10) no longer included GParted, so although Ubuntu is quite useful only with the older releases, having GParted ready for us to use.

I visited the Slax website and builtĀ a Slax release, which is the core release with the GParted utility and the libraries it needs to run. You can do the same or download it from the Linux Download page in the My Humax Blog, here: http://myhumax.org/blog/?page_id=189

This ISO is a small 203MB in size, so it should be faster to download than most Linux distributions. You can burn it to make a Live CD and boot up your computer temporarily to perform the USB drive format. Stick the CD in the drive and boot your PC via the CD-ROM drive. Your screen should look like the picture below:

Insert your USB drive if you’ve not done so. Slax will recognise your drive and will mount it. Start the GParted utility by clicking on the ‘K’ start button and choosing System and then GParted Partition Editor. Or you can open up the Terminal application (second icon on the bar at the bottom left corner of the desktop) and type ‘gparted’ followed by return. GParted should fire up as the screen below shows:

GParted on Slax

GParted will startup showing you the master hard disk’s configuration. Mine happens to be Ubuntu Linux. Under no circumstances should you modify your master hard disk (which most likely to be Windows). Windows partition type or filesystem will be marked as FAT32 or NTFS, example below:

A Windows formatted USB drive insert a USB drive, you

A few seconds after inserting a USB drive, Slax will pop-up a window askin you what you would like to do with it:

Prompt on inserting USB drive

If it is a drive you want to format to EXT3, then choose the ‘Do Nothing’ option and click on OK. Otherwise the drive will get mounted and you will not have the format option in GParted (cannot format a mounted drive).

Once GParted is running, pull down the drive menu in the top-right corner and select the drive you wish to format:

Select the drive to format

The image above states that I have 3 drives on my PC – the boot disk and 2 USB drives. I’m going to format a USB stick formatted in FAT32 called ‘KINGSTON’:

KINGSTON USB drive

Right click on the drive entry and choose ‘Format to’:

Format to EXT3

Then select EXT3. Once that is done, click on the ‘Apply’ button to get GParted to format the drive. It will ask you to confirm of course, before it will perform the action.

Formatting...

Done

If you have a drive that mis-behaves – GParted informing you that it can’t format the drive, you will need to delete the all the current partitions and create a new one on the drive. To do select the drive and choose ‘Partition’ from the menu.

Categories: How To Guides, Using Linux Tags: , , , ,

Formating a drive (to EXT3) with gparted

March 21st, 2011 6 comments

Well, I’ve shown you how you can upgrade your HDD in the various Humax PVRs, but with the newer ones the filesystem is the Linux FS EXT3, and with bigger than 1TB drives the box can not format them.

So here’s a quick post to show you how I formated my 1.5TB drive with Ubuntu and gparted (to complete my disk upgrading post).

The nice thing about Ubuntu is that it includes the GParted disk utility. It is graphical so easier to use than the CLI.

HDR-FOX T2 attempted to format the HDD

As you can see from the screengrab above, when I fired up gparted and selected the right HDD from the pulldown (highlighted in the red box), I can see the the HDR T3 started partitioning the drive – the first partition being 1GB in size… (This led me to the suspicion that it might have been able to format the whole drive given enough time. It might have taken it a lot longer than the 25 mins or so for me to doing to this by hand, however.)

So first thing to do is to complete the first partition by formatting it in EXT3 filesystem.

Put EXT3 filesystem on the partition

Select the right partition (here /dev/sdb1) and pull down the Partition menu, selecting Format and then ext3. Click on Apply to perform the action. A pop-up will ask you to confirm what you want to do.

Next thing to do is to divide up the second partition into two – remember the original HDD’s configuration? – three partitions: start partition 1Gb, end partition 10Gb, middle partition rest of disk.

Partition rest of disk

Select the second partition, and click on the ‘Partition’ menu option at the top, select ‘New’ from this menu. A pop-up should appear like the screengrab above. First uncheck the ‘Round to cylinders’ option (A). Type ’10240′ into ‘Free space following’ text box (B). When you tab away from box (B), the value of box (C) should be the remainder of your HDD. Simple! Remember you want to create your filesystem in the EXT3 format, so select that from the pulldown (D). Click on the Add button when finished.

Apply changes to HDD

You can now apply the changes to the HDD as you like it to be, or you could ‘format’ the third partition as EXT3. No changes will be made until to click on the ‘Apply’ button at the top, and confirm that you want to make the irreversible actions.

When gparted has finished it will give you a summary of actions made:

GParted summary

If you haven’t formated the 3rd partition to EXT3, do so now. When this is applied it should be fast and you have a HDD ready to put back into your HDR-FOX T2…

New partitioned and formatted 1.5TB drive