WD e-label

WD My Book Elite with e-label Some external HDDs from Western Digital (WD) - e.g. the WD My Book Elite - have a display which shows some information, including a user customizable label. This display is an e-label display, thus the present display state persists when power is removed. The display content is updated with WD's software SmartWare which automatically updates the shown free space information. Furthermore it can be used to modify the customizable label.

Unfortunately SmartWare is only provided for Windows and MacOS, but not for Linux. The drive furthermore hides the free space information when it is connected and no communication by SmartWare occurs within a few seconds. To solve this issue and to determine how exactly all the elements of the display can be enabled/disabled I decided to reverse-enigneer the protocol with the help of a Windows VM and a USB sniffer, in order to write a tool for controlling the display.

LeetCmd

This tool implements the protocol stated below and allows to modify the label and the free space information. Furthermore it is possible to enable/disable the virtual CD (VCD) or the display inversion. Note: This tool is not related in any way to WD.

 Download

Link LeetCmd v1.0 - PPA for Ubuntu 14.04/16.04 (i386/AMD64)

Archive LeetCmd v1.0 - C source code

 Release history

v1.0 (25.06.2016)

Protocol

All communication regarding the drive is done through the SCSI Enclosure Services (SES) device which belongs to the drive. The specific settings can be read/modified by using vendor-independent commands and vendor-specific parameters.
To not lock me out myself from my drive I did not take a look at the encryption function. At least I know that the lock symbol cannot be enabled/disabled seperately.

Notes:

Disable VCD flag

Initially when the drive is connected to a computer, an additional read-only CD drive appears which contains drivers and manuals. This Virtual CD (VCD) can be disabled via a flag.

Use the MODE SENSE command for reading and the MODE SELECT command for writing. The flag resides in mode page 0x20, sub-page 0x00. The page content is 6 bytes long; the flag itself is the 22th bit within the page content.

Mode page 0x20, sub-page 0x00
Byte offsetMeaning
0
1
2b1 = Disable VCD flag
3
4
5

Inverse Display flag

The display as a whole can optionally be displayed inverse via a flag.

Use the MODE SENSE command for reading and the MODE SELECT command for writing. The flag resides in mode page 0x21, sub-page 0x00. The page content is 10 bytes long; the flag itself is the 71th bit within the page content.

Mode page 0x21, sub-page 0x00
Byte offsetMeaning
0
1
2
3
4
5
6
7
8b0 = Inverse Display flag
9

Custom label

The user-customizable text label is stored in parallel in two different ways:

Plain text

The plain text is read/written by vendor-specific commands. tbd

Display segments

Use the RECEIVE DIAGNOSTIC RESULTS command for reading and the SEND DIAGNOSTIC command for writing. The data resides in diagnostic page 0x87. The page content is 32 bytes long; the label itself starts at offset 8 and uses two bytes per character.
Diagnostic page 0x87
Byte offsetMeaning Byte offsetMeaning
016Label char 5
117
218Label char 6
319
420Label char 7
521
622Label char 8
723
8Label char 124Label char 9
925
10Label char 226Label char 10
1127
12Label char 328Label char 11
1329
14Label char 430Label char 12
1531

The mapping of each segment to the regarding bit is shown in the following image (0 in the image equals to b0 of the 16bit value, 1 to b1 etc.).
Mapping of bits to segments

Free space

The free space fields are cleared after some seconds whenever the drive is connected to a system which does not run WD SmartWare. The regarding page therefore does not contain the present state - this also applies after the fields were updated by WD SmartWare. Therefore it is not possible to read out any previously written field content.
Use the RECEIVE DIAGNOSTIC RESULTS command for reading (a meaningless default) and the SEND DIAGNOSTIC command for writing. The data resides in diagnostic page 0x86. The page content is 16 bytes long.

Diagnostic page 0x86
Byte offsetMeaning
0(meaning unknown; must be 0x33!)
1(meaning unknown; must be 0x0A!)
2(meaning unknown; must be 0x03!)
3(meaning unknown; must be 0x00!)
4b7 = segment frame (needed for any segment!)
5
6b15-b6 = segments (MSB = most-left/top one)
7
8
9
10b4 = FREE indicator; b2 = TB indicator; b1 = GB indicator
11b1 = decimal point between free space 100s and 10s
12b7 = show digit; b3-b0 = BCD value (free space 100s)
13b7 = show digit; b3-b0 = BCD value (free space 10s)
14b7 = show digit; b3-b0 = BCD value (free space 1s)
15

Security lock

It seems that the security lock symbol is only displayed when encryption is enabled. Thus it is not possible to fake enabled encryption while it is in fact disabled. When a password is set, besides some other communication the password question is stored to the drive. tbd
Imprint