Author Topic: mount fat32 usb drive as read/write [solved --see page 3)]  (Read 3427 times)

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #15 on: July 20, 2012, 06:15:01 AM »
Ditzian,

I am still trying to figure out why you are creating mount points and manually trying to mount the drive. A removable USB drive will automatically mount in the /media directory if the filesystem has no errors. I don't know why you suddenly have problems with the drive, but I suspect it is all due to filesystem errors. As an example, and to duplicate what you have, I reformatted a USB thumb drive as FAT32 with a volume label of MY BOOK. Here is the mtab list, mount list, and permissions on my drive:

Code: [Select]
darrel@AMD64:  55 items 796Kb -> cat /etc/mtab
/dev/sda3 / ext4 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw 0 0
none /dev/shm tmpfs rw 0 0
/dev/sda2 /boot ext4 rw 0 0
/dev/sda5 /home ext4 rw 0 0
/dev/sdb1 /mnt/Data ext4 rw,noexec,nosuid,nodev 0 0
/dev/sdc1 /mnt/Vault ext4 rw,noexec,nosuid,nodev 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
gvfs-fuse-daemon /home/darrel/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=darrel 0 0
/dev/sdd1 /media/MY\040BOOK vfat rw,nosuid,nodev,noatime,uhelper=hal,shortname=lower,uid=500,flush,utf8 0 0

darrel@AMD64:  55 items 796Kb -> mount
/dev/sda3 on / type ext4 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda2 on /boot type ext4 (rw)
/dev/sda5 on /home type ext4 (rw)
/dev/sdb1 on /mnt/Data type ext4 (rw,noexec,nosuid,nodev)
/dev/sdc1 on /mnt/Vault type ext4 (rw,noexec,nosuid,nodev)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /home/darrel/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=darrel)
/dev/sdd1 on /media/MY BOOK type vfat (rw,nosuid,nodev,noatime,uhelper=hal,shortname=lower,uid=500,flush,utf8)

darrel@AMD64:  55 items 796Kb -> ls -l /media | grep MY
drwxr-xr-x 3 darrel root 8192 Jul 20 00:22 MY BOOK/

darrel@AMD64:  55 items 796Kb ->

udev does all the mounting of the drive automatically as soon as it is inserted. Notice that my drive, /dev/sdd1, was automatically mounted on /media/MY BOOK. It should be the same with yours. You do not need to modify /etc/fstab or manually mount the drive when it is inserted.

I have no problems writing to the drive, or erasing existing files. You say you have never connected the drive to a Windows machine. If you do not intend to connect it to a Windows machine, I would highly recommend you reformat the drive to a journaling filesystem, such as ext3 or ext4. FAT32 does not have journaling capabilities, which can lead to sudden unrecoverable data loss in some situations. Do you have existing files on the drive that you need to recover?

I am 99% sure fsck.vfat should have been run on that drive. If you want to try to repair it again, first use the mount command to be sure that /dev/sdb1 is not mounted. Then run as root:

fsck.vfat -afv

a=automatically repair the file system
f=salvage unused chains to files
v=verbose mode

If you want to see the full list of options before beginning, enter:

fsck.vfat --help


I had tried to mount with fstab because was not mounting, or not mounting as read/write when I plugged it in.  I have no particular desire to use fstab. 

Last night I put the drive on a Windows XP netbook and ran Western Digital's DLDIAG (it is a WD My_Book drive).  The full test showed no errors on the drive.  I will put the drive back on the PCLinuxOS computer and run fsck.vfat -afv later today or on Sunday, but I do not have high hopes. 

Jan



Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #16 on: July 20, 2012, 06:38:59 AM »
djohnston and muungwana,

I put the USB drive back on this PCLinuxOS computer, where PCC says it is now sdc.  It does not appear to be mounted, since (1) when I use Device Manager, Device Manager says that it cannot bring up a file manager because the drive is not mounted; and (2) there is no umount option when I look at it in PCC.

I opened Konsole and did su, then ran fsck on sdc1, the only partition.  Here is the result of the operation, which took only a few seconds.

Code: [Select]
[root@localhost jan]# fsck.vfat -afv /dev/sdc1
dosfsck 3.0.12 (29 Oct 2011)
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  67:cd/54, 68:61/1f, 69:89/fb, 70:93/16
  Not automatically fixing this.
Boot sector contents:
System ID "MSWIN4.1"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
     32768 bytes per cluster
        32 reserved sectors
First FAT starts at byte 16384 (sector 32)
         2 FATs, 32 bit entries
  61040640 bytes per FAT (= 119220 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 122097664 (sector 238472)
  15258273 data clusters (499983089664 bytes)
63 sectors/track, 255 heads
        63 hidden sectors
 976768002 sectors total
/mcmusic
 Start does point to root directory. Deleting dir.
Reclaiming unconnected clusters.
Unable to create unique name

Jan

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: mount fat32 usb drive as read/write
« Reply #17 on: July 20, 2012, 03:47:08 PM »

I put the USB drive back on this PCLinuxOS computer, where PCC says it is now sdc.


How many drives do you have? Why did you not run the mount command to see what shows as being mounted?
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #18 on: July 20, 2012, 04:15:18 PM »

I put the USB drive back on this PCLinuxOS computer, where PCC says it is now sdc.


How many drives do you have? Why did you not run the mount command to see what shows as being mounted?

Code: [Select]
[jan@localhost ~]$ mount
/dev/sda5 on / type ext4 (rw,relatime,commit=0)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda7 on /data type ext2 (rw)
/dev/sda6 on /home type ext4 (rw,relatime,user_xattr,commit=0)
none on /tmp type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/proc on /var/lib/named/proc type none (rw,bind)
/dev/sdb1 on /root/usr type vfat (rw,check=relaxed)
[jan@localhost ~]$


sda is the internal drive.  PCC says that the USB drive will be sdb, if I ever get it mounted.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10605
  • MLUs Forever!
Re: mount fat32 usb drive as read/write
« Reply #19 on: July 20, 2012, 04:26:17 PM »
USB drives when connected cannot be sure to get the same device designation at each connect.
So you cannot be sure that it will always be sdb or sdc etc

When the mounting is left to the OS it will mount the partition using its Label if it has one, or else using 'disk' or disk-1' etc ......  under /media, such as  /media/disk  ...

If using KDE you can determine if the device should be automounted or not at each insertion.

Quote
/dev/sdb1 on /root/usr type vfat (rw,check=relaxed)

Why is the partition mounted under root?

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #20 on: July 20, 2012, 05:10:07 PM »
USB drives when connected cannot be sure to get the same device designation at each connect.
So you cannot be sure that it will always be sdb or sdc etc

When the mounting is left to the OS it will mount the partition using its Label if it has one, or else using 'disk' or disk-1' etc ......  under /media, such as  /media/disk  ...

If using KDE you can determine if the device should be automounted or not at each insertion.

Quote
/dev/sdb1 on /root/usr type vfat (rw,check=relaxed)

Why is the partition mounted under root?


I was simply looking for a place to put it when I tried to mount it.  Do you have a more appropriate mount point?  I will be happy to change it.  BTW, I will soon have to turn off the computer until Sunday, but if you get any more thoughts I will take action as soon as I can do so.  I have a bit more time this evening, but I do not know when I will have to stop dealing with posts.  Thank you for helping me.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10605
  • MLUs Forever!
Re: mount fat32 usb drive as read/write
« Reply #21 on: July 20, 2012, 05:44:04 PM »
The usual place to mount internal partitions is under   /mnt    and removable partitions under   /media

Also to avoid any confusion I suggest you do not use as a mount point, the name of a system directory (usr), but something more related to the device.

That said ...

I suggest you do not manually mount the device, but unmount it, unplug it, and after about 20 secs or so, plug it in and IMMEDIATELY (without using any other app or utility) use the command

dmesg

in a konsole terminal. Post back the last lines relating to the insertion event.

Again without doing anything else, su to root and issue the following command

fdisk -l   <-- (lowercase L)

Post back the section of the output that relates to the USB disk.

I would like to see if there is any change after what you have already attempted.

After that is done launch Dolphin, and in the Places panel on the left, hover the mouse over the entry for the USB device.

Does it show a bar underneath indicating it is mounted?

If not click on the entry and report if the contents are then shown in Dolphin.

If yes ......  navigate to   /media     and find the directory for the device.

Report the Permissions and owner/group of the directory.

Get that updated info into one post.  ;)

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #22 on: July 21, 2012, 08:07:48 PM »
Just18,

Here is the relevant output of the first two tests:

Code: [Select]
usb 4-1: Product: My Book         
usb 4-1: Manufacturer: Western Digital
usb 4-1: SerialNumber: 57442D574341535533313832333833
scsi8 : usb-storage 4-1:1.0
scsi 8:0:0:0: Direct-Access     WD       5000AAV External 1.65 PQ: 0 ANSI: 4
sd 8:0:0:0: Attached scsi generic sg3 type 0
sd 8:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 21 00 00 00
sd 8:0:0:0: [sdb] No Caching mode page present
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sd 8:0:0:0: [sdb] No Caching mode page present
sd 8:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 8:0:0:0: [sdb] No Caching mode page present
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sd 8:0:0:0: [sdb] Attached SCSI disk
usb 4-1: USB disconnect, device number 6
usb 4-1: new high-speed USB device number 7 using ehci_hcd
usb 4-1: New USB device found, idVendor=1058, idProduct=1100
usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 4-1: Product: My Book         
usb 4-1: Manufacturer: Western Digital
usb 4-1: SerialNumber: 57442D574341535533313832333833
scsi9 : usb-storage 4-1:1.0
scsi 9:0:0:0: Direct-Access     WD       5000AAV External 1.65 PQ: 0 ANSI: 4
sd 9:0:0:0: Attached scsi generic sg3 type 0
sd 9:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 9:0:0:0: [sdc] Write Protect is off
sd 9:0:0:0: [sdc] Mode Sense: 21 00 00 00
sd 9:0:0:0: [sdc] No Caching mode page present
sd 9:0:0:0: [sdc] Assuming drive cache: write through
sd 9:0:0:0: [sdc] No Caching mode page present
sd 9:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 9:0:0:0: [sdc] No Caching mode page present
sd 9:0:0:0: [sdc] Assuming drive cache: write through
sd 9:0:0:0: [sdc] Attached SCSI disk
usb 2-1: USB disconnect, device number 2
usb 1-3: new low-speed USB device number 2 using ohci_hcd
usb 1-3: New USB device found, idVendor=046d, idProduct=c50a
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-3: Product: USB Receiver
usb 1-3: Manufacturer: Logitech
input: Logitech USB Receiver as /devices/pci0000:00/0000:00:12.0/usb1/1-3/1-3:1.0/input/input6
generic-usb 0003:046D:C50A.0002: input,hidraw0: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:12.0-3/input0
usb 4-1: USB disconnect, device number 7
[jan@localhost ~]$ su
Password:
[root@localhost jan]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 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
Disk identifier: 0x345d345c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63     8177084     4088511   82  Linux swap / Solaris
/dev/sda2         8177085  1953520064   972671490    5  Extended
/dev/sda5         8177148   131042204    61432528+  83  Linux
/dev/sda6       131042268   379133999   124045866   83  Linux
/dev/sda7       379134063  1005588674   313227306   83  Linux
/dev/sda8      1005588738  1030778594    12594928+  83  Linux
/dev/sda9      1030778658  1038955679     4088511   82  Linux swap / Solaris
/dev/sda10     1038955743  1953520064   457282161   83  Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x44fdfe06

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63   976768064   488384001    c  W95 FAT32 (LBA)
[root@localhost jan]#
The sdb probably refers to the original assignment for My_Book.  sdc probably is the newer assignment for My_Book.

I opened Dolphin, but My_Book is not an entry in the Places list.  The sole entries are: Home, Network, Root, Trash, Timeline, Movies, and Music.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10605
  • MLUs Forever!
Re: mount fat32 usb drive as read/write
« Reply #23 on: July 22, 2012, 05:31:19 AM »
Thanks for the info  ;)

I wonder why the Logitech device is listed after the USB drive .....  did you plug it in when doing the test?

It appears that your USB device is being attached without problems, but then almost immediately being disconnected again.

Is this a USB-powered device, or does it have its own external power supply?

What is happening reminds me of a situation where there is not sufficient power being supplied from the USB port for the device to operate properly. I know this does not seem likely because it apparently works fine in Win, but bear with me.

Can you plug the drive into a USB port with nothing else plugged in near it? .....  adjacent ports can use the same power supply so it would be helpful if it could be plugged in on its own.

Also, if you have available a powered hub, you could try plugging the drive into that.

Of course if it is externally powered then the above is unlikely to be helpful.

***

The only other idea that comes to mind is to save the data, wipe the complete drive, including Partition Table, and recreate the lot using Gparted.
Not something that is very nice with a large HDD ....

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #24 on: July 22, 2012, 07:25:02 AM »

Just18,

I wonder why the Logitech device is listed after the USB drive .....  did you plug it in when doing the test?
I accidentally unplugged the Logitech USB keyboard/mouse when I intended to unplug the USB My_Book connector.  I plugged the Logitech device back in, then removed the My_Book plug.

Quote
It appears that your USB device is being attached without problems, but then almost immediately being disconnected again.

Is this a USB-powered device, or does it have its own external power supply?

What is happening reminds me of a situation where there is not sufficient power being supplied from the USB port for the device to operate properly. I know this does not seem likely because it apparently works fine in Win, but bear with me.

Can you plug the drive into a USB port with nothing else plugged in near it? .....  adjacent ports can use the same power supply so it would be helpful if it could be plugged in on its own.
I will try this later today.

Quote
The only other idea that comes to mind is to save the data, wipe the complete drive, including Partition Table, and recreate the lot using Gparted.
Not something that is very nice with a large HDD ....


I had thought of this, but the only drive I have that is large enough for all the data is the drive on this PCLinuxOS computer.  However, if it comes to this, I may discard most of the stuff, which is backup, recreate as an Ext4 drive, and go back to using it as a backup drive, no longer compatible with Windows.  I don't like that alternative, because I wanted a more universally accessible drive.  An intermediate alternative is to back up and try again from scratch with Fat32.  Why should I use Gparted, rather than the PCLinuxOS PCC formatting software?

Thank you,
Jan

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #25 on: July 22, 2012, 11:55:16 AM »
Just18,

I  tried removing the printer, which is on a cabinet front USB port, and plugged the drive in there.  By the way, the external drive has its own power supply.

When I unplug the drive, the most recent device indicator still shows it, but, just as when I plug it in, it is not mounted.  I know that I did not realize this situation before, and it may say something to a person who actually understands what might be going on.

I have things set to automount on attach.  Should I try to eliminate this?  I like it when things are working, especially for the USB printer and keyboard/mouse, in case they become disconnected.  I am afraid that if I do not automount, I may have to reboot if I accidentally disconnect the keyboard/mouse combination.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10605
  • MLUs Forever!
Re: mount fat32 usb drive as read/write
« Reply #26 on: July 22, 2012, 12:07:24 PM »
The automount facility is for USB block device ....  drive partitions ....  so don't worry about turning it off.

The reason *appears* to be that the device is attached and then disconnected and so is not 'present' to be mounted correctly ....  automatically or manually.

As your filesystem checks do not appear to have done anything to help, it might be best to wipe and recreate both Partition Table and new partition/s.

Gparted is visually easier to use IMO, when doing the above.

If you get your data off that drive I suggest using Gparted to first create a new Partition Table, and then add a partition as you have presently. I would not change to a different partition type at this time.

Alternatively, you could first try to reduce the partition size by a few MBs using Gparted and see if that would fix it for you.

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #27 on: July 22, 2012, 12:32:35 PM »
Just18,

I installed gparted, but it does not launch, it dies during launch.  I looked a Synaptic and there is no program called libparted, there is only libparted0, which is installed.

Jan

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: mount fat32 usb drive as read/write
« Reply #28 on: July 22, 2012, 12:36:39 PM »
I tried gparted in a terminal as su:

Code: [Select]
[root@localhost jan]# gparted
Could not initialise connection to hald.
Normally this means the HAL daemon (hald) is not running or not ready.
[root@localhost jan]#

So I went to PCC and checked system services.  haldaemon is running, and cannot be stopped, so I cannot restart it.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10605
  • MLUs Forever!
Re: mount fat32 usb drive as read/write
« Reply #29 on: July 22, 2012, 12:41:46 PM »
I tried gparted in a terminal as su:

Code: [Select]
[root@localhost jan]# gparted
Could not initialise connection to hald.
Normally this means the HAL daemon (hald) is not running or not ready.
[root@localhost jan]#

So I went to PCC and checked system services.  haldaemon is running, and cannot be stopped, so I cannot restart it.

Jan


Click on the Start button .....  and wait a little .......  a wee box should eventually appear saying

Code: [Select]
Stopping HAL daemon: [OK]
Starting HAL daemon: [OK]

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT