tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

External HDD is write protected, why

Sun Jul 09, 2017 7:16 am

I have a 1TB Toshiba HDD that I use to keep all my files in one place. I upgraded my Pi2 Rasbian a few day ago and now I can not write to the disk. I have the official Debian / Pixel image that I use on an Acer Net Book and the same drive is not write protected on it.

What happened and why?

My USB stick auto mounts writable and so have a couple iPods.

How do I make the HDD writable again?

Dale

User avatar
DougieLawson
Posts: 35126
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: External HDD is write protected, why

Sun Jul 09, 2017 7:55 am

Start with a sudo fsck -f -y /dev/sdx# on for every partition on the drive.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Sun Jul 09, 2017 9:16 am

I did df and found that the HDD was /dev/sdb1. di sudo fsck -f -y /dev/sdb1 and it returned fsck from util-linux 2.25.2. doing ls -l /media/pi/Toshiba-Ext-HDD returned dr-x------ for all directory entries.

Powered off and on did update / upgrade nothing changed.

Ejected it and hooked up to another Pi2.

ls -l /media/pi/Toshiba-Ext-HDD on that system returned drwx------ for directories

Did df and it returned /dev/sda1

sudo fsck -f -y /dev/sda1 returned fsck from util-linux 2.25.2

Any idea why it is only write protected on this system?

Dale

User avatar
DougieLawson
Posts: 35126
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: External HDD is write protected, why

Sun Jul 09, 2017 9:21 am

Try this
sudo umount /dev/sda1
sudo fsck -f -y /dev/sda1
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

NotRequired
Posts: 190
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: External HDD is write protected, why

Sun Jul 09, 2017 10:35 am

First of all, you should supply information about the drives file system. Some file systems may be auto-mounted as read-only for different reasons. If the drive is formatted as Ext4, then your issue may be related to bad ownership and this can be fixed with: sudo chown -R pi:pi /media/pi/Toshiba-Ext-HDD
Please do not ask questions in private messages, they will not help others.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Sun Jul 09, 2017 11:13 pm

Thank you both for your replies and I tried both and it is still write protected. But it is only on this one system. The same drive is writable on 2 other current Raspbian systems, so the problem is with this image only. I can use the eject feature of the desktop and plug the drive into another RPi and have no problem as I have done for testing.

So how / why is it only write protected on one system?

If it was the file system type or corruption would that not apply to any Raspbian or Debian system I mounted it on?

While I have been around home computers since the late '70s (my older bro is a contract programmer since that time) I am a mechanic with a mech. eng. background.

Dale
Last edited by tech-mech on Mon Jul 10, 2017 9:43 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 35126
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: External HDD is write protected, why

Mon Jul 10, 2017 8:38 pm

What's in /etc/fstab?
Have you got the ntfs-3g driver installed if it's an NTFS drive?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Mon Jul 10, 2017 9:47 pm

proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that

This is what what it says, which is the same as another Pi2 that lets me write to it.

Dale

User avatar
DougieLawson
Posts: 35126
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: External HDD is write protected, why

Mon Jul 10, 2017 9:59 pm

What does sudo fdisk -l /dev/sda show?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Wed Jul 12, 2017 12:08 am

Here is the output of df

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 13475760 3959016 8809160 32% /
devtmpfs 435668 0 435668 0% /dev
tmpfs 440276 37808 402468 9% /dev/shm
tmpfs 440276 11572 428704 3% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 440276 0 440276 0% /sys/fs/cgroup
/dev/mmcblk0p6 66528 21418 45110 33% /boot
tmpfs 88056 0 88056 0% /run/user/1000
/dev/sda1 31314432 22691680 8622752 73% /media/pi/M-P-V
/dev/mmcblk0p5 30701 459 27949 2% /media/pi/SETTINGS
/dev/mmcblk0p1 1264784 1172128 92656 93% /media/pi/MUSICPLAYER
/dev/sdb1 976759996 348268112 628491884 36% /media/pi/Toshiba-Ext-HDD

Here is the output of sudo fdisk -l /dev/sda

Disk /dev/sda: 29.9 GiB, 32086425600 bytes, 62668800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 62653499 62645308 29.9G c W95 FAT32 (LBA)

Here is the output of sudo fdisk -l /dev/sdb1

Disk /dev/sdb1: 931.5 GiB, 1000202240000 bytes, 1953520000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x69205244

Device Boot Start End Sectors Size Id Type
/dev/sdb1p1 ? 218129509 1920119918 1701990410 811.6G 72 unknown
/dev/sdb1p2 ? 729050177 1273024900 543974724 259.4G 74 unknown
/dev/sdb1p3 ? 168653938 168653938 0 0B 65 Novell Netware 386
/dev/sdb1p4 2692939776 2692991410 51635 25.2M 0 Empty

I really want to fix this but am about to take it and the thumb drive (M-P-V) to another of my Pis and transfer the files. It is only this one system that is write protected.

Thanks for the help
Dale

User avatar
rpdom
Posts: 14107
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: External HDD is write protected, why

Wed Jul 12, 2017 4:52 am

tech-mech wrote:Here is the output of sudo fdisk -l /dev/sdb1
How about the output of sudo fdisk -l /dev/sdb ? That will be more helpful. sdb is the disk itself. sdb1 is the first partition on the disk. The fdisk output from it is just random jusnk. fdisk isn't all that clever at times.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Wed Jul 12, 2017 5:10 am

Here is the output of sudo fdisk -l /dev/sdb

Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcb0ea6bf

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 1953520063 1953520000 931.5G 7 HPFS/NTFS/exFAT

Here is what ls gives

ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 Jul 9 14:30 /dev/sdb

The only way I can write to it is to mount it on another Pi (or my net book which doesn't like the connector).

I am not having any problems reading from it.
Dale

User avatar
rpdom
Posts: 14107
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: External HDD is write protected, why

Wed Jul 12, 2017 5:25 am

tech-mech wrote:Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 1953520063 1953520000 931.5G 7 HPFS/NTFS/exFAT
Ok, that is what most of us expected to see from the symptoms you described.

The partition is formatted to NTFS and you don't have the ntfs-3g software installed on the Pi where it mounts read-only. The default NTFS Linux driver doesn't support writing, just reading. Basically you just need to do the following:

Code: Select all

sudo apt-get update
sudo apt-get -y install ntfs-3g
and then reboot and all should be well.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: External HDD is write protected, why

Wed Jul 12, 2017 7:05 am

Ok so that install now allows me to write to the disk.

Any idea why I could write to it on other Raspbian systems without doing that install? Also This is the first time I have had this problem and have used this HDD for a long time now.

Dale

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: External HDD is write protected, why

Wed Jul 12, 2017 11:41 am

tech-mech wrote:Any idea why I could write to it on other Raspbian systems without doing that install? Also This is the first time I have had this problem and have used this HDD for a long time now.
I assume they had ntfs-3g pre-installed.

If you're interested you can check that with

Code: Select all

apt-cache policy ntfs-3g
That gives you info on available versions and if it's installed or not.

Juanca
Posts: 2
Joined: Sat May 20, 2017 2:33 am

Re: External HDD is write protected, why

Wed May 22, 2019 8:51 pm

rpdom wrote:
Wed Jul 12, 2017 5:25 am
tech-mech wrote:Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 1953520063 1953520000 931.5G 7 HPFS/NTFS/exFAT
Ok, that is what most of us expected to see from the symptoms you described.

The partition is formatted to NTFS and you don't have the ntfs-3g software installed on the Pi where it mounts read-only. The default NTFS Linux driver doesn't support writing, just reading. Basically you just need to do the following:

Code: Select all

sudo apt-get update
sudo apt-get -y install ntfs-3g
and then reboot and all should be well.
Thanks a lot !, your answer save my day.
In MHO fsck MUST report that a module is missing.

Return to “General discussion”