I'm currently experiencing strange behavior when using a new external usb hard drive that I believe that the behavior is related to a mount issue, a file system issue or actual hardware failure. It should help the community if I mention what I've done to correct the problem and what I've used to mount the usb hard drive.
File System
The USB hard drive was formatted in Ubuntu in a VM on my windows machine. It was then later moved to physical ubuntu server.
USB Mount
I installed USB Mount using sudo apt-get install usbmount
after which I then was able to browse the hard drive and write to it via /media/usb
.
All good until...
I got to around 20GB on the hard drive, there after I was getting failures via FTP when copying to the device. Now the strange problem is that when I use sudo cp filename
and write to the device I get zero errors. The errors reported via Flashfxp are either disk full or error read/write input error.
Using Pmount
Removing USBMount and using Pmount does not resolve the issue other than I see /media/usb0
rather than just /usb/
Removing both pmount and usbmount I can still see /media/usb0/
which I found pretty odd.
Fdisk reports several problems
The below is a report from using fdisk as you can see it looks like I have no file system on sdb which is strange as I can view it. Using fdisk /dev/sdb/ I am unable to view any partitions nor can I delete them, even when creating one.
simon@Pluto2:/media/usb0$ sudo fdisk -l
Disk /dev/sda: 37.0 GB, 37019566080 bytes 255 heads, 63 sectors/track, 4500 cylinders, total 72303840 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: 0x000c5772
Device Boot Start End Blocks Id System /dev/sda1 * 2048 499711 248832 83 Linux /dev/sda2 501758 72302591 35900417 5 Extended /dev/sda5 501760 72302591 35900416 8e Linux LVM Note: sector size is 4096 (not 512)
Disk /dev/sdb: 2000.4 GB, 2000398929920 bytes 255 heads, 63 sectors/track, 30400 cylinders, total 488378645 sectors Units = sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x0001b7d6
Device Boot Start End Blocks Id System
Disk /dev/mapper/Pluto2--vg-root: 32.6 GB, 32635879424 bytes 255 heads, 63 sectors/track, 3967 cylinders, total 63741952 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: 0x00000000
Disk /dev/mapper/Pluto2--vg-root doesn't contain a valid partition table
Disk /dev/mapper/Pluto2--vg-swap_1: 4123 MB, 4123000832 bytes 255 heads, 63 sectors/track, 501 cylinders, total 8052736 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: 0x00000000
Disk /dev/mapper/Pluto2--vg-swap_1 doesn't contain a valid partition table
Running fsck
I found several guides online and one of them mentioned to run fsck... sadly this just makes the issue for me a lot more confusing.
simon@Pluto2:/media/usb0$ sudo fsck /dev/sdb
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Running e2fsck -b 8193 and -b 32768
simon@Pluto2:/media/usb0$ sudo e2fsck -b 32768 /dev/sdb
e2fsck 1.42.9 (4-Feb-2014)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Running smartctl -i
simon@Pluto2:/media/usb0$ sudo smartctl -d sat -i /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST2000DM001-1CH164
Serial Number: XXXXXXXXXX
LU WWN Device Id: 5 000c50 06636209d
Firmware Version: CC49
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Tue Dec 9 21:31:44 2014 GMT
==> WARNING: A firmware update for this drive is available,
see the following Seagate web pages:
http://knowledge.seagate.com/articles/en_US/FAQ/207931en
http://knowledge.seagate.com/articles/en_US/FAQ/223651en
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Running smartctl -d sat -t short /dev/sdb
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 258
Under 20GB Mark
It's also worth mentioning that If I delete 5gb of data I can then write another 5gb to the device without problems.. its only when the drive gets used to a certain point which could indicate bad sectors but then I'd expect to be able to run various tools on the device.
dmesg
for more information after getting an error, and check the output ofmount
. Are you sure it is ext4 and it is on /dev/sdb?sudo journalctl
in terminal. This will open full long inless
and you exit the log by pressingq
. If you know how to reproduce the issue, it might be easier to just runsudo journalctl -f
in a terminal and then repeat the problem and finally press CTRL+C in the terminal window running journalctl to stop the output. Usually you'll find some kind of error messages and Google will help you forward when you search for the verbatim error message.