NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
bullfrog1
Oct 31, 2011Tutor
compiling idle3tools under qemu for sparc
Hi
I'm trying to compile idle3tools using the qemu development environment for sparc platform.
At the moment it's compiling with warnings, however when I then run it on the readynas nv+ I'm also then getting an error.
During compiling I get the following warnings.
idle3ctl.c:48: warning: function declaration isn't a prototype
idle3ctl.c:89: warning: function declaration isn't a prototype
idle3ctl.c:113: warning: function declaration isn't a prototype
idle3ctl.c:137: warning: no previous prototype for 'VSC_send_key'
idle3ctl.c:167: warning: function declaration isn't a prototype
idle3ctl.c:174: warning: function declaration isn't a prototype
idle3ctl.c:183: warning: no previous prototype for 'VSC_get_timer'
idle3ctl.c:214: warning: no previous prototype for 'VSC_set_timer'
idle3ctl.c:245: warning: no previous prototype for 'cleanup'
idle3ctl.c:253: warning: no previous prototype for 'show_version'
idle3ctl.c:259: warning: no previous prototype for 'show_usage'
I do however get a compiled program at the end of the process.
Transfering this to the NV+ and running it I get the following.
./idle3ctl -h
idle3ctl v0.9.1 - Read, Set or disable the idle3 timer of Western Digital drives
Copyright (C) 2011 Christophe Bothamy
Usage: idle3ctl [options] device
Options:
-h : displat help
-V : show version and exit immediately
-v : verbose output
--force : force even if no Western Digital HDD are detected
-g : get raw idle3 timer value
-g100 : get idle3 timer value as wdidle3 v1.00 value
-g103 : get idle3 timer value as wdidle3 v1.03 value
-g105 : get idle3 timer value as wdidle3 v1.05 value
-d : disable idle3 timer
-s<value> : set idle3 timer raw value
./idle3ctl /dev/hdc
sg16(VSC_ENABLE) failed: Invalid argument
.fdisk -l /dev/hdc
gives information about one of the disks so I've got the correct device name.
I've also tried replacing the sgio.c and sgio.h in the idle3ctl package with sgio which is part of hdparam from the source of the readynas radiator for the sparc, but the differences are too great, I'm not an experienced linux compiler, so getting out of my depth rapidly.
Any suggestions welcome
Thanks
Jeremy (Bullfrog)
I'm trying to compile idle3tools using the qemu development environment for sparc platform.
At the moment it's compiling with warnings, however when I then run it on the readynas nv+ I'm also then getting an error.
During compiling I get the following warnings.
idle3ctl.c:48: warning: function declaration isn't a prototype
idle3ctl.c:89: warning: function declaration isn't a prototype
idle3ctl.c:113: warning: function declaration isn't a prototype
idle3ctl.c:137: warning: no previous prototype for 'VSC_send_key'
idle3ctl.c:167: warning: function declaration isn't a prototype
idle3ctl.c:174: warning: function declaration isn't a prototype
idle3ctl.c:183: warning: no previous prototype for 'VSC_get_timer'
idle3ctl.c:214: warning: no previous prototype for 'VSC_set_timer'
idle3ctl.c:245: warning: no previous prototype for 'cleanup'
idle3ctl.c:253: warning: no previous prototype for 'show_version'
idle3ctl.c:259: warning: no previous prototype for 'show_usage'
I do however get a compiled program at the end of the process.
Transfering this to the NV+ and running it I get the following.
./idle3ctl -h
idle3ctl v0.9.1 - Read, Set or disable the idle3 timer of Western Digital drives
Copyright (C) 2011 Christophe Bothamy
Usage: idle3ctl [options] device
Options:
-h : displat help
-V : show version and exit immediately
-v : verbose output
--force : force even if no Western Digital HDD are detected
-g : get raw idle3 timer value
-g100 : get idle3 timer value as wdidle3 v1.00 value
-g103 : get idle3 timer value as wdidle3 v1.03 value
-g105 : get idle3 timer value as wdidle3 v1.05 value
-d : disable idle3 timer
-s<value> : set idle3 timer raw value
./idle3ctl /dev/hdc
sg16(VSC_ENABLE) failed: Invalid argument
.fdisk -l /dev/hdc
gives information about one of the disks so I've got the correct device name.
I've also tried replacing the sgio.c and sgio.h in the idle3ctl package with sgio which is part of hdparam from the source of the readynas radiator for the sparc, but the differences are too great, I'm not an experienced linux compiler, so getting out of my depth rapidly.
Any suggestions welcome
Thanks
Jeremy (Bullfrog)
6 Replies
Replies have been turned off for this discussion
- Baxxx1AspirantHi Jeremy!
i also have two WD-drives with idle3 Problem (EARX 2GB). And as my Windows PC doesnt want to boot with the raid-drive connected, i thought about installing idle3 tools on the raid itself, too.
the problem you are facing could be that the drive /dev/hdc is not the physical drive, but the raid array (xraid, raid1, raid0).
so the question would be, if there are further block devices (/dev/sd?, /dev/hd?) which are accessible directly or if the hardware raid bocks access to those devices.
i will check at home after work.
greetings from Austria,
Baxxx - Hi Baxxx
Thanks for the assistance. I could attach the drives to a pc, however it strikes me that saving everyone the trouble of doing this would be beneficial. I've basically the makings of an addon, just need to get the idle3tool to run properly and I'm done. However getting it to run is the final hurdle. As far as I can tell the 4 devices for the 4 drives are (/dev/hdc, /dev/hde, /dev/hdg, /dev/hdi) . However reconfirmation would be most useful. I've run smartctl -a against each device and I seem to get manufacturer and smart data for each drive.
As suggested it does appear to be an access problem, with the verbose option against idle3tools I get a failure at the very beginning of the program.
./idle3ctl -v -g /dev/hdc
Checking if Drive is a Western Digital Drive
outgoing cdb: 85 08 2e 00 00 00 00 00 00 00 00 00 00 40 ec 00
ioctl(fd,SG_IO): Invalid argument
Trying legacy HDIO_DRIVE_CMD
Enabling Vendor Specific ATA commands
outgoing cdb: 85 06 20 00 45 00 00 00 00 00 44 00 57 a0 80 00
ioctl(fd,SG_IO): Invalid argument
sg16(VSC_ENABLE) failed: Invalid argument
From what I gather the drive is accessed using sg_io which is some sort of scsi routine, which has been doctored to use sata commands, and for some reason this is failing. I've now patched in the sgio.c/sgio.h from the hdparam in the radiator source and it compiles too but when run has the same error, so definately appears to be some sort of accessing problem to me, either the wrong device name or using the wrong method to access the drive. Smartctl the program that frontview uses to display smart information appears to use ioctl/ataioctl/scsiioctl rather than sg_io so perhaps I should investigate that, I've been working on this for about 4 hours now , so I'm going to give it a rest for a bit.
Thanks for your assistance. Greetings from the UK
Jeremy - Hi
I've added some extra code to see if I can determine the whats happening
results below
./idle3ctl -v -g /dev/hdc
Checking if Drive is a Western Digital Drive
outgoing cdb (sgio.c): 85 08 2e 00 00 00 00 00 00 00 00 00 00 40 ec 00
ioctl (fd,SG_IO), errno=22
ioctl(fd,SG_IO) (sgio.c) : Invalid argument
Trying legacy HDIO_DRIVE_CMD
return code,rc=0
The drive /dev/hdc appears to be a Western Digital Drive it's a WDC WD20EARS-00MVWB0
Enabling Vendor Specific ATA commands
outgoing cdb (sgio.c): 85 06 20 00 45 00 00 00 00 00 44 00 57 a0 80 00
ioctl (fd,SG_IO), errno=22
ioctl(fd,SG_IO) (sgio.c) : Invalid argument
sg16(VSC_ENABLE) failed: Invalid argument
The sg16/SG_IO command is failing with error code 22 which apparently means 22.ENAMETOOLONG Filename too long
Apparently this error can occur when the buffer is too small so as this drive is a 4K sector drive not a 512 byte drive, I increased the buffer size to 4096 bytes but that made no difference either.
So now officially stuck.
Going to see if I can contact the original creator of idle3tools.
Jeremy - Baxxx1AspirantHi Jeremy!
did you try the same on /dev/hde ?
for your info:
dmesg tells me the following:NAS:~# dmesg
X_RAID_DUMP
VERSION/ID : SB=(V:0.1.0) ID=<c7506636.00000000.00000000.00000000> CT:4ea4525f
RAID_INFO : DISKS(TOTAL:2 RAID:2 PARITY:0 ONL:2 WRK:2 FAILED:0 SPARE:0 BASE:1)
SZ:3907008688 UT:00000000 STATE:0 LUNS:2 EXTCMD:1 LSZ:3907008686
LOGICAL_DRIVE : 0: B:0000000002 E:0004096000 R:1 O:1 I:1:000000000 DM:3
LOGICAL_DRIVE : 1: B:0004096002 E:3902912686 R:1 O:1 I:1:000000000 DM:3
PHYSICAL_DRIVE: 0: DISK<N:0/1,hdc(22,0),ID:0,PT:1,SZ:3907008688,ST:P :online>
PHYSICAL_DRIVE: 1: DISK<N:1/2,hde(33,0),ID:1,PT:1,SZ:3907008688,ST: B:online>
CURRENT_DRIVE : DISK<N:0/1,XXX(22,0),ID:0,PT:1,SZ:3907008688,ST:P :online>
VERSION/ID : SB=(V:0.1.0) ID=<c7506636.00000000.00000000.00000000> CT:4ea4525f
RAID_INFO : DISKS(TOTAL:2 RAID:2 PARITY:0 ONL:2 WRK:2 FAILED:0 SPARE:0 BASE:1)
SZ:3907008688 UT:00000000 STATE:0 LUNS:2 EXTCMD:1 LSZ:3907008686
LOGICAL_DRIVE : 0: B:0000000002 E:0004096000 R:1 O:1 I:1:000000000 DM:3
LOGICAL_DRIVE : 1: B:0004096002 E:3902912686 R:1 O:1 I:1:000000000 DM:3
PHYSICAL_DRIVE: 0: DISK<N:0/1,hdc(22,0),ID:0,PT:1,SZ:3907008688,ST:P :online>
PHYSICAL_DRIVE: 1: DISK<N:1/2,hde(33,0),ID:1,PT:1,SZ:3907008688,ST: B:online>
CURRENT_DRIVE : DISK<N:1/2,XXX(33,0),ID:1,PT:1,SZ:3907008688,ST: B:online>
VERSION/ID : SB=(V:0.1.0) ID=<c7506636.00000000.00000000.00000000> CT:4ea4525f
RAID_INFO : DISKS(TOTAL:2 RAID:2 PARITY:0 ONL:2 WRK:2 FAILED:0 SPARE:0 BASE:1)
SZ:3907008688 UT:00000000 STATE:0 LUNS:2 EXTCMD:1 LSZ:3907008686
LOGICAL_DRIVE : 0: B:0000000002 E:0004096000 R:1 O:1 I:1:000000000 DM:3
LOGICAL_DRIVE : 1: B:0004096002 E:3902912686 R:1 O:1 I:1:000000000 DM:3
PHYSICAL_DRIVE: 0: DISK<N:0/1,hdc(22,0),ID:0,PT:1,SZ:3907008688,ST:P :online>
PHYSICAL_DRIVE: 1: DISK<N:1/2,hde(33,0),ID:1,PT:1,SZ:3907008688,ST: B:online>
CURRENT_DRIVE : DISK<N:0/1,XXX(22,0),ID:0,PT:1,SZ:3907008688,ST:P :online>
RUN_PARAMETERS: raid_running=1,last_word=ok,interface_start_at=1,fake=0
RAID_REBUILD : sync=0,logical=0,parity=1,sectors/TOTAL=0/4294967295
: source=1, total_drives=1, auto_sync=1
RAID_P_CHECK : chck=0,logical/total=0/2,raid_level=0
: err/sectors/TOTAL=0/0/0,report_err=1
: initialized=0x3,initialize_error=0x0,initializing=0x0
: where=0,total=3907029168
SIZE_INFOR : sb_size=9440,sections_size=32/256,disk_t_size=128
: sb=f8140294,disks=512/1536,luns=2048/3168,thisdisk=5216/128,diskid=5344/4096
DJO_RECORD : dj_raid=NO_RAID,chns=0,source=0,disks=0 parity=0,chn_image=3,
: sectors=3498562/0x356242,need_IO=1
IO__RECORD : 0=166992,1=48414802,2=0,3=0, busy=0/0/1/0/0,t_d=3
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
fdisk /dev/hdcNAS:~# fdisk /dev/hdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3b2ff3b9.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 243200.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/hdc: 2000.3 GB, 2000388448256 bytes
255 heads, 63 sectors/track, 243200 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3b2ff3b9
Device Boot Start End Blocks Id System
Command (m for help): q
NAS:~#
fdisk /dev/hdeNAS:~# fdisk /dev/hde
The number of cylinders for this disk is set to 243200.
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/hde: 2000.3 GB, 2000388448256 bytes
255 heads, 63 sectors/track, 243200 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/hde1 1 255 2048000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/hde2 255 287 256000 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/hde3 287 243200 1951192152 5 Extended
/dev/hde5 287 243200 1951192151+ 8e Linux LVM
Command (m for help): q
NAS:~#
so hdc and hde are the physical disks, but they are differently partitioned ?!?
it doesn't make sense to me ....
for me hde seems to be the "current disk", but no partitions on hdc?
good luck and thaks for your efforts!
Bax - Baxxx1AspirantHi!
did you find out anything new!!!
greetings
Bax - Hi
I've made no further progress for the moment. I opted for pulling each drive out individually and using the wd idle3 program running under dos to do the setting. I'll come back to this project sometime in the future.
One drive in each x-raid configuration is used entirely for parity, apparently this has no partition table on it.
Regards
Bullfrog
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!