Password Protected WD External Drive Hard Disk: How to unlock on Linux?

I know it sometimes pains to see things working fine and easy in windows OS but not in Linux. One of the things was using my age-old WD hard drive, but password-protected kept hidden in caves due to password-protected I finally managed to access it easily.

Below is the command list run one by one without stoping or read to get the idea what each commands does.

**Updated : For ubunut 20.04 & python3 I was facing issue. So Steps mentioned at the end helped

Command list

sudo apt-get install python3-pip python-dev lsscsi  

sudo pip install py_sg  

cd ~; wget

sudo python3 ~/ -u   

lsblk  // to know name of mounted name ( ie MOUNTED_NAME)

sudo python3 ~/ -u -m -d MOUNTED_NAME 

//(in my case it was => [sdb           8:16   0   1.8T  0 disk ]
// comand would be : sudo python3 ~/ -u -m -d /dev/sdb

To remove password (Not recommended): sudo python ~/ -c

Step 1 : Install the packages required

sudo apt-get install python3-pip python-dev lsscsi

Step2: Install library “py_sg” [driver to interact SCSI devices]

sudo pip install py_sg  

Step3 : Install WD Utilities

cd ~; wget

Step 4: Tada ! . Open Your drive and check your stuff !!

sudo python3 ~/ -u

Not Recommended but if you wish to remove the password run the below command .

sudo python ~/ -c

Enjoy exploring your drive.

Thanks You !!!!


**Issue faced in ubuntu20.04 & python3 & solution

After succesfully following the above commands was getting below error

Traceback (most recent call last):
  File "/home/bitsofjarvis/", line 11, in <module>
    import pyudev
ImportError: No module named pyudev

Multiple python version were installed, so this particular missing module “pyudev” needs to be installed

bitsof@jarvis:~$ pip install pyudev

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyudev in ./.local/lib/python2.7/site-packages (0.23.2)
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from pyudev) (1.14.0)

By default above pip was installing in python2.7 . So I installed for python3

bitsof@jarvis:~$ sudo pip install pyudev

Output : 

Collecting pyudev
  Downloading pyudev-0.23.2-py3-none-any.whl (63 kB)
     |████████████████████████████████| 63 kB 1.9 MB/s 
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from pyudev) (1.14.0)
Installing collected packages: pyudev
Successfully installed pyudev-0.23.2

 bitsof@jarvis:~$ python3 -m pip install pyudev
 bitsof@jarvis:~$ python3.8 -m pip install pyudev  // was not sure which one to be used, I am still naive at this

output : You need to install the “py_sg” module. Try ‘pip3 install –user git+’.

//(SKIP below a &  b command . NOT REQUIRED NOW)
//a.) pip3 install --user git+
//b.)  sudo pip3 install --user git+


use command :
sudo python3 ~/ -u

sudo python3 ~/ -u

if Output is =

 [!] Multiple Western Digital Passport devices found. Use --device /dev/_ to choose.

then RUN :

sudo python3 ~/ -u -m -d MOUNT_NAME  // mount name of your drive

identify the drive name usiing :: “lsblk

& using below command I was able to access it.

sudo python3 ~/ -u -m -d /dev/sdb

Phewwww !!!!!!!!!!!!!!!!!!!!
After lots of If & buts , I accessed it. Hurray !.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments

Enjoy this blog? Please spread the word :)

Would love your thoughts, please comment.x