A Linux way to disable the Virtual CD on WD disks

According to Western Digital, there is no known way under Linux to disable (and hide) the “Virtual CD” (VCD) partition that can often be found on their external hard disks (such as the popular My Passport series).

No results with Google either, so I had to dig a little further. Please keep in mind that the following solution worked well for me, but that it could, potentially, brick your hard disk. You’ve been warned.


Here is the log output for my brand new WD My Passport:

Sep 01 15:41:07 thinkpad-linux kernel: scsi 6:0:0:0: Direct-Access     WD       My Passport 25A8 1005 PQ: 0 ANSI: 6
Sep 01 15:41:07 thinkpad-linux kernel: scsi 6:0:0:1: CD-ROM            WD       Virtual CD 25A8  1005 PQ: 0 ANSI: 6
Sep 01 15:41:07 thinkpad-linux kernel: scsi 6:0:0:2: Enclosure         WD       SES Device       1005 PQ: 0 ANSI: 6
Sep 01 15:41:07 thinkpad-linux kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
Sep 01 15:41:07 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Spinning up disk...
Sep 01 15:41:07 thinkpad-linux kernel: sr 6:0:0:1: [sr0] scsi3-mmc drive: 51x/51x caddy
Sep 01 15:41:07 thinkpad-linux kernel: sr 6:0:0:1: Attached scsi CD-ROM sr0
Sep 01 15:41:07 thinkpad-linux kernel: sr 6:0:0:1: Attached scsi generic sg3 type 5
Sep 01 15:41:07 thinkpad-linux kernel: ses 6:0:0:2: Attached Enclosure device
Sep 01 15:41:07 thinkpad-linux kernel: ses 6:0:0:2: Attached scsi generic sg4 type 13
Sep 01 15:41:12 thinkpad-linux kernel: .
Sep 01 15:41:12 thinkpad-linux kernel: ready
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] 3906963456 512-byte logical blocks: (2.00 TB/1.82 TiB)
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Write Protect is off
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Mode Sense: 53 00 10 08
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] No Caching mode page found
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through
Sep 01 15:41:12 thinkpad-linux kernel:  sdc: sdc1
Sep 01 15:41:12 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Attached SCSI disk

See the virtual cd-rom at /dev/sr0? Also note that the hard disk appears as /dev/sdc on my system, so you will have to update the following commands accordingly if your disk has a different system letter.

Western Digital uses undocumented, vendor-unique SCSI mode pages. One of the page is page 0x20, which contains the information necessary to enable or disable the virtual cd.

First you need to install sdparm. Under Debian (and its derivatives) you can install it with

$ sudo apt-get install sdparm

Then run the following command (keep in mind to adjust the drive letter to match it with your WD hard disk), which reads out mode page 0x20 of your disk.

$ sudo sdparm --page=0x20 --hex /dev/sdc
[0x20] mode page:
    Current:
 00     a0 06 30 00 30 00 00 00
    Changeable:
 00     a0 06 00 00 23 00 00 00
    Default:
 00     a0 06 30 00 30 00 00 00
    Saved:
 00     a0 06 30 00 30 00 00 00 

Of interest is the fifth byte with the value 0x30 – or 00110000 in bits. By manipulating its second bit, we can disable or reenable the virtual cd. To disable it, run the following command:

sudo sdparm --page=0x20 --set 4:1:1=1 --save /dev/sdc

Now check out mode page 0x20 again:

$ sudo sdparm --page=0x20 --hex /dev/sdc
[0x20] mode page:
    Current:
 00     a0 06 30 00 32 00 00 00
    Changeable:
 00     a0 06 00 00 23 00 00 00
    Default:
 00     a0 06 30 00 30 00 00 00
    Saved:
 00     a0 06 30 00 32 00 00 00

That’s it! No more virtual disk. Unplug and plugin your hard disk, and check out the log files:

Sep 01 15:48:30 thinkpad-linux kernel: scsi 6:0:0:0: Direct-Access     WD       My Passport 25A8 1005 PQ: 0 ANSI: 6
Sep 01 15:48:30 thinkpad-linux kernel: scsi 6:0:0:1: Enclosure         WD       SES Device       1005 PQ: 0 ANSI: 6
Sep 01 15:48:30 thinkpad-linux kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
Sep 01 15:48:30 thinkpad-linux kernel: ses 6:0:0:1: Attached Enclosure device
Sep 01 15:48:30 thinkpad-linux kernel: ses 6:0:0:1: Attached scsi generic sg3 type 13
Sep 01 15:48:30 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Spinning up disk...
Sep 01 15:48:32 thinkpad-linux kernel: .
Sep 01 15:48:35 thinkpad-linux kernel: ready
Sep 01 15:48:35 thinkpad-linux kernel: sd 6:0:0:0: [sdc] 3906963456 512-byte logical blocks: (2.00 TB/1.82 TiB)
Sep 01 15:48:35 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Write Protect is off
Sep 01 15:48:35 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Mode Sense: 53 00 10 08
Sep 01 15:48:35 thinkpad-linux kernel: sd 6:0:0:0: [sdc] No Caching mode page found
Sep 01 15:48:35 thinkpad-linux kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through

If you want to reenable the virtual disk, use the following command:

sudo sdparm --page=0x20 --set 4:1:1=0 --save /dev/sdc

Leave a Reply

Your email address will not be published. Required fields are marked *