New external hard drive is read-only in Linux

Asked by Lucy Dixon

I'm new to Linux. A friend partitioned my laptop, installed Ubuntu in one partition and left Windows 7 in the other. My old WD external hard drive shows up with problems - apparently it's sufferings from OLD-AGE - with Linux.

So I bought a new Samsung S2 Portable 3.0 1TB hard drive to take all my photos, music, movies and back-ups. The manual says that by default it is formatted to FAT32/NTFS.

So first problem: the hard drive wasn't showing up in Linux. I switched over to Windows, and it popped up, and I did a test run with a back-up of the Windows partition. All worked fine.

Went back to Linux, and now the drive shows up. But it's read-only. I can't copy anything across to it, and I'm at risk of losing all my pictures, which are part of my work.

Help! I'm by no means a technical sort, so this is all very frustrating.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gparted Edit question
Assignee:
No assignee Edit question
Solved by:
Lucy Dixon
Solved:
Last query:
Last reply:
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#1

If you can back the files up in Windows (but not in Ubuntu), you should do that first. You're right that the longer you wait, the higher the chance that the files will be lost. (As you probably can relate to now, it is highly recommended to have at least one backup copy of all important files, made at the time that the files are created or edited. Data loss occurs frequently, on all types of computer systems, and for many reasons.)

Then, in the Ubuntu system, make sure you can view the drive's contents (go to Places and click on the entry for the drive). Then open up a Terminal window (Applications > Accessories > Terminal) and paste the command:

sudo fdisk -l

Then press enter to run the command. You will probably be asked for your password; if so, type in your password and press enter. It's OK that you don't see any placeholder characters (like *) as you are entering your password.

Copy all the text from the Terminal window, and paste it here. That should provide diagnostic information useful to solving your problem.

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#2

Hi Eliah

Thanks for that. I've done as you've suggested, and here's what comes up. Hope it's the right stuff!

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x70000000

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 5591 44798976 7 HPFS/NTFS
/dev/sda3 5591 9475 31200256 83 Linux
/dev/sda4 9475 9730 2048000 5 Extended
/dev/sda5 9475 9730 2046976 82 Linux swap / Solaris

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x41ffc810

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 38912 312560608+ c W95 FAT32 (LBA)

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x26966788

   Device Boot Start End Blocks Id System
/dev/sdc1 * 1 121601 976760000+ c W95 FAT32 (LBA)

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#3

Yes, that information is the right stuff indeed. This part indicates that the 1 TB drive on your system consists of one partition, formatted FAT32 (it indicates other information too):

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x26966788

   Device Boot Start End Blocks Id System
/dev/sdc1 * 1 121601 976760000+ c W95 FAT32 (LBA)

The default behavior of Ubuntu is to treat FAT32 volumes as unmodifiable by regular users. You could make Ubuntu let you write to it. But I recommend formatting it NTFS. FAT32 has numerous limitations not present in more modern filesystems. The one that most commonly causes people problems for large drives used for storage is that it cannot store a file that is bigger than 4 GB. There are a number of good filesystems, but these days NTFS is the one that is well-supported (and without painstaking configuration) on both Windows and most Linux-based systems like Ubuntu. If you format the drive NTFS and attach it to a Mac OS X system, it will be read-only on that system (though there are easily usable, proprietary, for-pay drivers to enable NTFS write support on that OS).

Formatting the drive NTFS will wipe out any data already on it. You can format the drive in Ubuntu with GParted (System > Administration > GParted Partition Editor). Alternatively, you can use the Disk Utility (System > Administration > Disk Utility). In Windows you can format it NTFS with the Disk Management utility (in XP or earlier, Start > Run > diskmgmt.msc -- in Vista or 7, type diskmgmt.msc in the text box that appears at the bottom of the Start Menu).

Rather than reformatting it NTFS, you can convert it from FAT32 to NTFS, and retain the data that is on it. However, that process still carries a significant (though relatively low) risk of damaging or destroying some or all of the files in the partition being converted, so important files on volumes being converted from one format to another should be backed up before that operation is undertaken. Converting the partition takes a lot of time, and if you can easily afford (in terms of time, effort, and the ability to back up files) to reformat it NTFS instead, that's probably a better option.

While I recommend you make it NTFS, if you choose to keep it FAT32 and want to be able to write to it in Ubuntu, please reply to that effect and I'll try and help you with that.

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#4

As the only files on it are the back-up of the windows side, I think I'll go for the NTFS option. I've had a look at GParted, and have found the device, but I'd greatly appreciate some step-by-step instructions as what do next!

When I tried to follow their instructions, I could not unmount /dev/sdc1.
Text ended before matching quote was found for ". (The text was 'sh -c 'umount -v "/media/LFD'S\040DRIVE"'')

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#5

Was the line

Text ended before matching quote was found for ". (The text was 'sh -c 'umount -v "/media/LFD'S\040DRIVE"'')

the exact text of an error message that you received in GParted? If so, please describe exactly what you did which produced that error message, and if there were any other errors or any other part of the error messages besides that line.

It seems like you may have found a bug in GParted. Fortunately, if so, then this is likely a bug that is easily worked around (that is, you should be able to reformat the partition NTFS without waiting for the bug to be fixed).

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#6

Also, please run the command "mount" (without the quotes) in the Terminal and paste its output here.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#7

(I accidentally clicked "Add Answer" when I sent the first of the above two replies, instead of "Add Information Request", which is why this question is now incorrectly marked Answered. I'm sorry about that. When you reply, that will reopen the question, so this shouldn't cause any problems.)

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#8

(Actually, I now see that I didn't make that mistake. Rather, after my first answer--the long one--you replied by adding a comment instead of indicating that you needed more assistance. You can disregard my last message, which, like this one, is completely enclosed in parentheses. In the future, for best results, I recommend changing a Question's status from Answered back to Open if you are requesting additional assistance, so that people, including whoever posted the original answer, know that you are asking for more help.)

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#9

Ok, here's what I did. I went to System>Administration>GParted Editor and opened it. From the Toolbar, I selected GParted>Devices, and chose the new external hard drive. I left-clicked on it to select it, then right-clicked and chose Unmount. And this was the exact error message that appeared: Text ended before matching quote was found for ". (The text was 'sh -c 'umount -v "/media/LFD'S\040DRIVE"'')

And here's what comes up when I run "mount" in the terminal:

/dev/sda3 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/lucy/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=lucy)
/dev/sdb1 on /media/MUSIC & BU type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
/dev/sda1 on /media/System Reserved type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdc1 on /media/LFD'S DRIVE type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
/dev/sda2 on /media/DACC7874CC784CAF type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
lucy@lucy-notebook:~$

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#10

I've also tried the Disk Utility thingy, but that was also giving me gyp! It wouldn't unmount at first, so I safely removed the drive from my USB hub, and plugged it directly into the laptop. Now it unmounts with Disk Utility, but still not with GParted.

Maybe I should go ahead with Disk Utility? Bu then the question is, do I format the Volume (is that the partition), or format the Drive?

As you can tell, I really don't have the foggiest!

thanks

Lucy

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#11

I've also tried the Disk Utility thingy, but that was also giving me gyp! It wouldn't unmount at first, so I safely removed the drive from my USB hub, and plugged it directly into the laptop. Now it unmounts with Disk Utility, but still not with GParted.

Maybe I should go ahead with Disk Utility? Bu then the question is, do I format the Volume (is that the partition), or format the Drive?

As you can tell, I really don't have the foggiest!

thanks

Lucy

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#12

It seems that you have indeed stumbled upon a bug in GParted. It is unable to perform certain operations (perhaps any operation) on a partition (or at least a FAT32 partition) with an single-quote (apostrophe) in its name.

Assuming that the Disk Utility it not affected by a similar bug, you should be able to use it to good effect. Format the volume, rather than the drive. As you suspect, the volume is the partition. Where I have used the term "volume" above, I have also used it synonymously with "partition" (perhaps things are now a big less confusing!).

Formatting the drive itself, rather than the volume, would wipe out all partitions by wiping out and recreating the partition table itself. You would use that to create a fresh partition table, and to change type of the partition table itself. You don't need to do that.

(Please remember, as discussed above, that formatting the partition will clobber any files on that are contained within it. Make sure not to perform this action on the wrong drive by accident!)

Revision history for this message
Lucy Dixon (lucyfdixon) said :
#13

Yeeha!! It's worked. All reformatted, and currently copying the first 30GB of photographs.

thank you so much, Eliah!