LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 02-27-2013, 07:15 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Strange behavior with new SATA III drive


I don't know whether this is a Slackware problem per se.

I updated my HTPC to Slackware 14.0. I moved the system to a new Western Digital WD10EZEX 1TB SATA 3 drive and have a second of the same model for cloning. Although the ASUS M3N78-EM motherboard only supports SATA 2, I nonetheless noticed speed improvements with the newer SATA 3 drive.

Before installing the new 1TB drives I performed a full dd if=/dev/zero and smartctl long test. No problems or errors encountered. All seems well except for a single and annoying anomaly.

After a shutdown/reboot, Xbmc (10.1) takes about 20 seconds to load. Xbmc will start immediately with any subsequent load as long as I don't reboot or shutdown. When I manually flush the kernel cache, Xbmc still starts normally within 5 seconds. The oddball behavior appears only after a reboot/shutdown.

By shutdown I mean the system is using standby power in order to self-awaken for scheduled recordings.

The Xbmc log shows no related errors or warnings but does show a repeatable 16 second pause early in the log. The 16 second gap never appears thereafter or when using the older hard drive.

Uncertain whether the problem was the new hard drive, I temporarily restored my previous Western Digital WD6400AAKS 640 GB SATA 2 drive (same Slackware 14.0). Amazingly, Xbmc then always started in about 5 seconds, even after a reboot/shutdown. Swapping back to the new 1TB drive and again Xbmc takes about 20 seconds to load after a reboot/shutdown. I again swapped to the older drive and Xbmc started normally.

I see the same results with the second "cloned" drive," somewhat affirming the anomaly is related to the drives.

Although SATA 3 devices auto-negotiate to SATA 2, and my dmesg log indicates the drive is booting at 3.0 Gps, I nonetheless tried a jumper across pins 5 and 6, which limits the drive to 3.0 Gps. No change in dmesg or Xbmc.

On a whim I recompiled Xbmc on the HTPC rather than my normal office system. No change.

I'm at a loss how to resolve the problem short of buying new drives or using the older drive (that has 360 GB less capacity). I don't want to autostart Xbmc as I don't always use Xbmc when starting the system.

Any ideas?

Thanks.

P.S. Yes, I'm aware Xbmc 12.0 is available. Not interested at the moment.

Last edited by Woodsman; 02-27-2013 at 07:27 PM.
 
Old 02-28-2013, 12:33 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,985

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
How did you partition the drive?
How did you move the system to the new drive?

My first guess is that the drive is not aligned correctly and your not using 4KB sector boundaries.
 
Old 02-28-2013, 02:26 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
I used gparted to create the partitions, which defaults to using MiB alignment rather than cylinder alignment. I used the defaults.

All partitions are ext4 except the data (videos) partition, which is xfs.

/dev/sda1 /boot (ext4)
/dev/sda2 swap
/dev/sda3 /home (ext4)
/dev/sda4 extended
/dev/sda5 /usr/local (ext4)
/dev/sda6 /tmp (ext4)
/dev/sda7 /var (ext4)
/dev/sda8 / (ext4)
/dev/sda9 data (xfs)

After creating the partitions on the new drive I copied the files from the old drive to the new drive. I did not use dd because I wanted to increase some of the partition sizes on the newer, larger drive and perform some nominal file/directory tweaking. I performed the updates using partedmagic. The entire operation was fast except copying files from the data partition, because many of the files are large video files.

I haven't noticed any other problem with the new drive. To have only one app behave oddly is a head scratcher. The xbmc files are on an ext4 partition (sda8).

fstab:

/dev/sda8 / ext4 defaults,noatime 0 1

All partitions are using a 4096 block size, except sda1 (/boot), which is a small 128M partition and uses a 1024 block size:

tune2fs -l /dev/sdaX | grep "Block size"

Block size: 4096

fdisk does not complain about sector boundaries:

fdisk -lu /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0006861b

Device Boot Start End Blocks Id System
/dev/sda1 2048 264191 131072 83 Linux
/dev/sda2 264192 2361343 1048576 82 Linux swap
/dev/sda3 2361344 44304383 20971520 83 Linux
/dev/sda4 44304384 1953523711 954609664 5 Extended
/dev/sda5 44306432 46403583 1048576 83 Linux
/dev/sda6 46405632 48502783 1048576 83 Linux
/dev/sda7 48504832 50601983 1048576 83 Linux
/dev/sda8 50604032 79964159 14680064 83 Linux
/dev/sda9 79966208 1953523711 936778752 83 Linux

The block size on the older drive is also 4096.

Please explain why sector boundaries would cause such an anomaly.

Thanks!
 
Old 02-28-2013, 02:36 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,985

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
http://www.ibm.com/developerworks/li...-sector-disks/
 
Old 02-28-2013, 02:48 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Okay, but I'm only seeing this behavior with one single app, not the entire drive.

hdparm shows the new drive performing faster:

hdparm -tT /dev/sda (new drive)

/dev/sda:
Timing cached reads: 2122 MB in 2.00 seconds = 1061.63 MB/sec
Timing buffered disk reads: 540 MB in 3.01 seconds = 179.69 MB/sec

hdparm -tT /dev/sdb (old drive)

/dev/sdb:
Timing cached reads: 2128 MB in 2.00 seconds = 1064.01 MB/sec
Timing buffered disk reads: 334 MB in 3.00 seconds = 111.18 MB/sec

The strange part is the 16 second delay disappears with subsequent starts, even after flushing the linux cache.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Behavior 1TB Hard Disk Drive Igby Linux - Server 4 05-28-2009 12:31 PM
Strange behavior, while booting from an external Hard Drive (USB) vasmakk Linux - Newbie 8 05-03-2009 01:19 AM
Sata Raid 1 and Single Sata drive drive order issue Kvetch Linux - Hardware 5 03-19-2007 06:50 PM
Strange USB flash drive behavior SamuelHenderson Linux - Hardware 3 09-17-2006 11:03 PM
strange behavior abhijit Linux - General 3 07-09-2003 11:25 PM


All times are GMT -5. The time now is 11:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration