USB drive stop working while is in use - linux

First of all i'm sorry for my english.
I post here because i've searched a long time in google and i've not found anything useful.
Well my problem is with an external USB drive: I've a Debian wheezy Server full updated with kernel 3.2.0-4-686-pae, and i've bought an USB drive to extend it storage.
The problem is when i start to copy a lot of files to external storage, then the drive stop working. I've seen that drive continues mounted but it becomes unresponsive and the only way to get it working is disconnecting the USB and then reconnecting again.
The USB drive is a Seagate Expansion Desktop 2TB 3.5" USB3.0 with external power supply.
The syslog shows this:
Jul 18 10:57:38 SomeServer kernel: [163444.176034] usb 1-2: reset high-speed USB device number 12 using ehci_hcd
Jul 18 10:57:38 SomeServer kernel: [163444.300025] usb 1-2: device descriptor read/64, error -71
Jul 18 10:57:38 SomeServer kernel: [163444.528031] usb 1-2: device descriptor read/64, error -71
Jul 18 10:57:39 SomeServer kernel: [163444.744043] usb 1-2: reset high-speed USB device number 12 using ehci_hcd
Jul 18 10:57:39 SomeServer kernel: [163444.868054] usb 1-2: device descriptor read/64, error -71
Jul 18 10:57:39 SomeServer kernel: [163445.096045] usb 1-2: device descriptor read/64, error -71
Jul 18 10:57:39 SomeServer kernel: [163445.312044] usb 1-2: reset high-speed USB device number 12 using ehci_hcd
Jul 18 10:57:40 SomeServer kernel: [163445.724044] usb 1-2: device not accepting address 12, error -71
Jul 18 10:57:40 SomeServer kernel: [163445.836063] usb 1-2: reset high-speed USB device number 12 using ehci_hcd
Jul 18 10:57:40 SomeServer kernel: [163446.248060] usb 1-2: device not accepting address 12, error -71
Jul 18 10:57:40 SomeServer kernel: [163446.248133] usb 1-2: USB disconnect, device number 12
Jul 18 10:57:40 SomeServer kernel: [163446.248152] sd 6:0:0:0: Device offlined - not ready after error recovery
Jul 18 10:57:40 SomeServer kernel: [163446.248179] sd 6:0:0:0: [sdc] Unhandled error code
Jul 18 10:57:40 SomeServer kernel: [163446.248184] sd 6:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
Jul 18 10:57:40 SomeServer kernel: [163446.248192] sd 6:0:0:0: [sdc] CDB: Write(10): 2a 00 16 c3 7a 2a 00 00 1e 00
Jul 18 10:57:40 SomeServer kernel: [163446.248211] end_request: I/O error, dev sdc, sector 3055276368
Jul 18 10:57:40 SomeServer kernel: [163446.248244] Buffer I/O error on device sdc1, logical block 381909290
Jul 18 10:57:40 SomeServer kernel: [163446.248278] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.248286] Buffer I/O error on device sdc1, logical block 381909291
Jul 18 10:57:40 SomeServer kernel: [163446.248320] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.248328] Buffer I/O error on device sdc1, logical block 381909292
Jul 18 10:57:40 SomeServer kernel: [163446.248359] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.248366] Buffer I/O error on device sdc1, logical block 381909293
Jul 18 10:57:40 SomeServer kernel: [163446.248402] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.248408] Buffer I/O error on device sdc1, logical block 381909294
Jul 18 10:57:40 SomeServer kernel: [163446.248437] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.248443] Buffer I/O error on device sdc1, logical block 381909295
Jul 18 10:57:40 SomeServer kernel: [163446.249782] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.249790] Buffer I/O error on device sdc1, logical block 381909296
Jul 18 10:57:40 SomeServer kernel: [163446.249820] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.249826] Buffer I/O error on device sdc1, logical block 381909297
Jul 18 10:57:40 SomeServer kernel: [163446.249855] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.249861] Buffer I/O error on device sdc1, logical block 381909298
Jul 18 10:57:40 SomeServer kernel: [163446.249889] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.249895] Buffer I/O error on device sdc1, logical block 381909299
Jul 18 10:57:40 SomeServer kernel: [163446.249923] lost page write due to I/O error on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.249997] sd 6:0:0:0: [sdc] Unhandled error code
Jul 18 10:57:40 SomeServer kernel: [163446.250002] sd 6:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Jul 18 10:57:40 SomeServer kernel: [163446.250010] sd 6:0:0:0: [sdc] CDB: Write(10): 2a 00 16 c3 7a 48 00 00 1e 00
Jul 18 10:57:40 SomeServer kernel: [163446.250028] end_request: I/O error, dev sdc, sector 3055276608
Jul 18 10:57:40 SomeServer kernel: [163446.346073] JBD: Detected IO errors while flushing file data on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.346259] journal_bmap: journal block not found at offset 16396 on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.346302] Aborting journal on device sdc1.
Jul 18 10:57:40 SomeServer kernel: [163446.346375] JBD: I/O error detected when updating journal superblock for sdc1.
Jul 18 10:57:40 SomeServer kernel: [163446.346433] __journal_remove_journal_head: freeing b_committed_data
Jul 18 10:57:40 SomeServer kernel: [163446.346579] __journal_remove_journal_head: freeing b_committed_data
Jul 18 10:57:40 SomeServer kernel: [163446.374086] JBD: Detected IO errors while flushing file data on sdc1
Jul 18 10:57:40 SomeServer kernel: [163446.374142] __journal_remove_journal_head: freeing b_frozen_data
Jul 18 10:57:40 SomeServer kernel: [163446.374147] __journal_remove_journal_head: freeing b_frozen_data
Jul 18 10:57:40 SomeServer kernel: [163446.374151] __journal_remove_journal_head: freeing b_frozen_data
Jul 18 10:57:40 SomeServer kernel: [163446.374154] __journal_remove_journal_head: freeing b_committed_data
Jul 18 10:57:40 SomeServer kernel: [163446.374158] __journal_remove_journal_head: freeing b_frozen_data
Jul 18 10:57:40 SomeServer kernel: [163446.374190] journal commit I/O error
Jul 18 10:57:40 SomeServer kernel: [163446.394650] EXT3-fs (sdc1): error: ext3_journal_start_sb: Detected aborted journal
Jul 18 10:57:40 SomeServer kernel: [163446.394724] EXT3-fs (sdc1): error: remounting filesystem read-only
Jul 18 10:57:41 SomeServer kernel: [163446.820598] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.820722] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.820817] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.820910] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821006] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821101] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821194] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821290] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821386] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821480] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821578] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821669] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821765] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821864] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.821962] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822059] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822157] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822254] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822351] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822454] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822556] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822648] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822740] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822847] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.822950] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.823041] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.823144] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #93773868 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.823632] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92577799 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.831563] __journal_remove_journal_head: freeing b_frozen_data
Jul 18 10:57:41 SomeServer kernel: [163446.840980] sd 6:0:0:0: [sdc] Synchronizing SCSI cache
Jul 18 10:57:41 SomeServer kernel: [163446.841033] sd 6:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Jul 18 10:57:41 SomeServer kernel: [163446.863650] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.865293] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.865900] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.903243] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.912264] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.927942] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.928606] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.929807] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.933678] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.935572] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.936040] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.936901] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.937351] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.939195] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.939678] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.940349] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.940860] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.941317] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.941758] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.942208] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.942617] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.943089] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.943557] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.944000] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.944757] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.945234] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.945651] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.946142] EXT3-fs error (device sdc1): ext3_find_entry: reading directory #92561409 offset 0
Jul 18 10:57:41 SomeServer kernel: [163446.952110] usb 1-2: new high-speed USB device number 13 using ehci_hcd
I've tried to change the USB port, delete the partition and repartitioning with fdisk again, EXT3 and EXT4 format... and i don't know if is a Linux problem or maybe the USB drive is defective.
Yesterday i was able to copy about 170GB without problem, then i tried to copy a file of about 68GB and it started to fail.
Someone knows what can be failing?. I want to know it before replacing the unit with a new unit and continue having problems.
Thanks!!

Related

Why is my emmc card recognized as /dev/sdd instead of /dev/mmcblk0?

My desktop has a built-in SD/mini/MMC/RS card slot and I can use my eMMC card as storage device without problems. But under /dev directory it is recognized as /dev/sdd, which I think should be /dev/mmcblk0 or something. Here's the output of dmesg -T concerning sd part:
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] 15269888 512-byte logical blocks: (7.81 GB/7.28 GiB)
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] Write Protect is off
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] Mode Sense: 03 00 00 00
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] No Caching mode page found
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] Assuming drive cache: write through
[Thu Nov 5 10:57:14 2015] sd 5:0:0:0: [sdb] Attached SCSI removable disk
[Thu Nov 5 10:57:14 2015] sd 5:0:0:1: [sdc] Attached SCSI removable disk
[Thu Nov 5 10:57:14 2015] sdd: sdd1
[Thu Nov 5 10:57:14 2015] sd 5:0:0:3: [sde] Attached SCSI removable disk
[Thu Nov 5 10:57:14 2015] sd 5:0:0:2: [sdd] Attached SCSI removable disk
The problem is that I want to use ioctl with MMC_IOC_CMD request to test its functionality, so I can compare the result/response with another FPGA-simulated eMMC controller. On an embedded arm board with Linux (3.0.1) installed this same eMMC card is recognized correctly as /dev/mmcblk0, and I can successfully send some commands to it. But on the Desktop, open("/dev/sdd", O_RDWR), then ioctl(fd, IOC_MMC_CMD, args) returns EINVAL.
Maybe the problem is the card isn't correctly recognized as sd/mmc card? How could I make it realized as mmcblkX so that I can interact with it on my PC (Arch Linux)?

Raspberry Pi USB mount error (sd* letter always changes) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I wanted to set up a torrent server with my Raspberry Pi 2 and with a 16 GB USB.
My fstab:
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
/dev/sda1 /mnt/usb ext4 defaults 0 0
It worked for a few minutes, and then the transmission-daemon had input-output error. Then I saw in the /proc/partitions file, that the USB isn't sda any more, but sdb. So I mounted it manually to /mnt/usb (sudo mount /dev/sdb1 /mnt/usb). But after a few minutes transmission-daemon had the same error, and sdb changed to sdc. I also tried to format my USB, but it didn't work even if I had an NTFS filesystem on my USB.
Dmesg said some errors too:
[ 450.036334] usb 1-1.4: reset high-speed USB device number 42 using dwc_otg
[ 450.907015] usb 1-1.4: USB disconnect, device number 42
[ 450.916493] sd 5:0:0:0: [sdb]
[ 450.916523] Result: hostbyte=0x01 driverbyte=0x00
[ 450.916541] sd 5:0:0:0: [sdb] CDB:
[ 450.916553] cdb[0]=0x2a: 2a 00 01 78 80 70 00 00 f0 00
[ 450.916618] blk_update_request: I/O error, dev sdb, sector 24674416
[ 450.916650] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084332)
[ 450.916672] Buffer I/O error on device sdb1, logical block 3084046
[ 450.916719] Buffer I/O error on device sdb1, logical block 3084047
[ 450.916739] Buffer I/O error on device sdb1, logical block 3084048
[ 450.916757] Buffer I/O error on device sdb1, logical block 3084049
[ 450.916776] Buffer I/O error on device sdb1, logical block 3084050
[ 450.916793] Buffer I/O error on device sdb1, logical block 3084051
[ 450.916811] Buffer I/O error on device sdb1, logical block 3084052
[ 450.916828] Buffer I/O error on device sdb1, logical block 3084053
[ 450.916846] Buffer I/O error on device sdb1, logical block 3084054
[ 450.916863] Buffer I/O error on device sdb1, logical block 3084055
[ 450.917060] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084392)
[ 450.917221] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084422)
[ 450.917375] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084452)
[ 450.917530] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084482)
[ 450.917682] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084512)
[ 450.917835] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084542)
[ 450.917985] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084544)
[ 450.918065] sd 5:0:0:0: [sdb]
[ 450.918080] Result: hostbyte=0x01 driverbyte=0x00
[ 450.918096] sd 5:0:0:0: [sdb] CDB:
[ 450.918106] cdb[0]=0x2a: 2a 00 01 78 81 60 00 00 f0 00
[ 450.918168] blk_update_request: I/O error, dev sdb, sector 24674656
[ 450.918193] EXT4-fs warning (device sdb1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 770637824 size 1114112 starting block 3084362)
[ 450.918327] Aborting journal on device sdb1-8.
[ 450.918404] JBD2: Error -5 detected when updating journal superblock for sdb1-8.
[ 450.926386] blk_update_request: I/O error, dev sdb, sector 0
[ 450.965297] EXT4-fs error (device sdb1): ext4_journal_check_start:56: Detected aborted journal
[ 450.965364] EXT4-fs (sdb1): Remounting filesystem read-only
[ 451.005340] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 451.005551] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 451.005911] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 451.006405] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 451.006540] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 451.007847] EXT4-fs warning (device sdb1): __ext4_read_dirblock:884: error -5 reading directory block (ino 2, block 0)
[ 451.022015] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm gvfsd-trash: reading directory lblock 0
[ 451.022288] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #2: comm gvfsd-trash: reading directory lblock 0
[ 451.039755] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 451.039933] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 451.040011] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 451.636367] usb 1-1.4: new high-speed USB device number 43 using dwc_otg
[ 451.741850] usb 1-1.4: New USB device found, idVendor=090c, idProduct=1000
[ 451.741876] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 451.741894] usb 1-1.4: Product: USB Flash Disk
[ 451.741911] usb 1-1.4: Manufacturer: General
[ 451.741927] usb 1-1.4: SerialNumber: 0107000000011210
[ 451.743734] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[ 451.744258] scsi host6: usb-storage 1-1.4:1.0
[ 453.040465] scsi 6:0:0:0: Direct-Access General USB Flash Disk 1100 PQ: 0 ANSI: 6
[ 453.041762] sd 6:0:0:0: Attached scsi generic sg0 type 0
[ 453.042685] sd 6:0:0:0: [sdc] 31490048 512-byte logical blocks: (16.1 GB/15.0 GiB)
[ 453.043669] sd 6:0:0:0: [sdc] Write Protect is off
[ 453.043698] sd 6:0:0:0: [sdc] Mode Sense: 43 00 00 00
[ 453.044665] sd 6:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 453.126409] usb 1-1.4: reset high-speed USB device number 43 using dwc_otg
[ 453.554715] sdc: sdc1
[ 453.565480] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[ 461.356064] EXT4-fs (sdc1): recovery complete
[ 462.443547] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null)
[ 462.536762] usb 1-1.4: reset high-speed USB device number 43 using dwc_otg
[ 463.558275] EXT4-fs error: 5 callbacks suppressed
[ 463.558315] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 463.560901] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 463.563529] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 463.565388] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 463.634130] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 463.636388] EXT4-fs error (device sdb1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 578.048876] usb 1-1.4: reset high-speed USB device number 43 using dwc_otg
[ 580.069629] usb 1-1.4: USB disconnect, device number 43
[ 580.088851] sd 6:0:0:0: [sdc]
[ 580.088881] Result: hostbyte=0x01 driverbyte=0x00
[ 580.088900] sd 6:0:0:0: [sdc] CDB:
[ 580.088912] cdb[0]=0x2a: 2a 00 00 c4 26 10 00 00 08 00
[ 580.088977] blk_update_request: I/O error, dev sdc, sector 12854800
[ 580.089000] Buffer I/O error on dev sdc1, logical block 1606594, lost sync page write
[ 580.089107] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982174)
[ 580.089129] buffer_io_error: 232 callbacks suppressed
[ 580.089144] Buffer I/O error on device sdc1, logical block 2981888
[ 580.089192] Buffer I/O error on device sdc1, logical block 2981889
[ 580.089215] Buffer I/O error on device sdc1, logical block 2981890
[ 580.089236] Buffer I/O error on device sdc1, logical block 2981891
[ 580.089260] Buffer I/O error on device sdc1, logical block 2981892
[ 580.089280] Buffer I/O error on device sdc1, logical block 2981893
[ 580.089301] Buffer I/O error on device sdc1, logical block 2981894
[ 580.089322] Buffer I/O error on device sdc1, logical block 2981895
[ 580.089343] Buffer I/O error on device sdc1, logical block 2981896
[ 580.089364] Buffer I/O error on device sdc1, logical block 2981897
[ 580.089510] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982204)
[ 580.089693] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982234)
[ 580.089878] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982264)
[ 580.090063] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982294)
[ 580.090245] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982324)
[ 580.090428] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982354)
[ 580.090616] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982384)
[ 580.090791] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982414)
[ 580.091004] EXT4-fs warning (device sdc1): ext4_end_bio:317: I/O error -5 writing to inode 260640 (offset 352321536 size 1441792 starting block 2982444)
[ 580.091497] JBD2: Error -5 detected when updating journal superblock for sdc1-8.
[ 580.091733] Aborting journal on device sdc1-8.
[ 580.091790] JBD2: Error -5 detected when updating journal superblock for sdc1-8.
[ 580.165173] EXT4-fs error (device sdc1): ext4_journal_check_start:56: Detected aborted journal
[ 580.165223] EXT4-fs (sdc1): Remounting filesystem read-only
[ 580.169410] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.169620] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.169719] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.169794] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.169973] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.170050] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.170112] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.170179] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
[ 580.178082] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 580.178334] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #2: comm pool: reading directory lblock 0
[ 580.678933] usb 1-1.4: new high-speed USB device number 44 using dwc_otg
[ 580.784418] usb 1-1.4: New USB device found, idVendor=090c, idProduct=1000
[ 580.784448] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 580.784466] usb 1-1.4: Product: USB Flash Disk
[ 580.784482] usb 1-1.4: Manufacturer: General
[ 580.784499] usb 1-1.4: SerialNumber: 0107000000011210
[ 580.786308] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[ 580.786843] scsi host7: usb-storage 1-1.4:1.0
[ 582.083966] scsi 7:0:0:0: Direct-Access General USB Flash Disk 1100 PQ: 0 ANSI: 6
[ 582.085891] sd 7:0:0:0: Attached scsi generic sg0 type 0
[ 582.087744] sd 7:0:0:0: [sdd] 31490048 512-byte logical blocks: (16.1 GB/15.0 GiB)
[ 582.088711] sd 7:0:0:0: [sdd] Write Protect is off
[ 582.088740] sd 7:0:0:0: [sdd] Mode Sense: 43 00 00 00
[ 582.089890] sd 7:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 582.097623] sdd: sdd1
[ 582.102909] sd 7:0:0:0: [sdd] Attached SCSI removable disk
[ 583.864490] EXT4-fs (sdd1): recovery complete
[ 583.864537] EXT4-fs (sdd1): mounted filesystem with ordered data mode. Opts: (null)
[ 583.949085] usb 1-1.4: reset high-speed USB device number 44 using dwc_otg
[ 905.411955] EXT4-fs error: 5 callbacks suppressed
[ 905.411994] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 905.415351] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 905.418646] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 905.421045] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 905.422771] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 905.425328] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1619.454353] EXT4-fs error (device sdc1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1671.150949] usb 1-1.4: USB disconnect, device number 44
[ 1671.152308] blk_update_request: I/O error, dev sdd, sector 0
[ 1671.159210] sd 7:0:0:0: [sdd] Synchronizing SCSI cache
[ 1671.159556] sd 7:0:0:0: [sdd]
[ 1671.159575] Result: hostbyte=0x01 driverbyte=0x00
[ 1674.198477] usb 1-1.2: new high-speed USB device number 45 using dwc_otg
[ 1674.303962] usb 1-1.2: New USB device found, idVendor=090c, idProduct=1000
[ 1674.303988] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1674.304006] usb 1-1.2: Product: USB Flash Disk
[ 1674.304023] usb 1-1.2: Manufacturer: General
[ 1674.304040] usb 1-1.2: SerialNumber: 0107000000011210
[ 1674.305851] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 1674.306351] scsi host8: usb-storage 1-1.2:1.0
[ 1675.608760] scsi 8:0:0:0: Direct-Access General USB Flash Disk 1100 PQ: 0 ANSI: 6
[ 1675.610728] sd 8:0:0:0: Attached scsi generic sg0 type 0
[ 1675.611007] sd 8:0:0:0: [sdd] 31490048 512-byte logical blocks: (16.1 GB/15.0 GiB)
[ 1675.612004] sd 8:0:0:0: [sdd] Write Protect is off
[ 1675.612032] sd 8:0:0:0: [sdd] Mode Sense: 43 00 00 00
[ 1675.612989] sd 8:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1675.621378] sdd: sdd1
[ 1675.626508] sd 8:0:0:0: [sdd] Attached SCSI removable disk
[ 1677.426106] EXT4-fs (sdd1): recovery complete
[ 1677.426151] EXT4-fs (sdd1): mounted filesystem with ordered data mode. Opts: (null)
[ 1677.508594] usb 1-1.2: reset high-speed USB device number 45 using dwc_otg
[ 1699.728493] usb 1-1.2: reset high-speed USB device number 45 using dwc_otg
[ 1706.888517] usb 1-1.2: reset high-speed USB device number 45 using dwc_otg
[ 1707.218479] usb 1-1.2: device descriptor read/64, error -71
[ 1708.088519] usb 1-1.2: reset high-speed USB device number 45 using dwc_otg
[ 1708.988506] usb 1-1.2: reset high-speed USB device number 45 using dwc_otg
[ 1710.979144] usb 1-1.2: USB disconnect, device number 45
[ 1710.988746] sd 8:0:0:0: [sdd]
[ 1710.988775] Result: hostbyte=0x01 driverbyte=0x00
[ 1710.988794] sd 8:0:0:0: [sdd] CDB:
[ 1710.988807] cdb[0]=0x2a: 2a 00 00 c4 26 40 00 00 18 00
[ 1710.988871] blk_update_request: I/O error, dev sdd, sector 12854848
[ 1710.988973] Aborting journal on device sdd1-8.
[ 1710.989059] JBD2: Error -5 detected when updating journal superblock for sdd1-8.
[ 1710.991653] sd 8:0:0:0: [sdd] Synchronizing SCSI cache
[ 1710.991959] sd 8:0:0:0: [sdd]
[ 1710.991984] Result: hostbyte=0x01 driverbyte=0x00
[ 1711.033811] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #2: comm gvfsd-trash: reading directory lblock 0
[ 1711.034142] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #2: comm gvfsd-trash: reading directory lblock 0
[ 1711.588496] usb 1-1.2: new high-speed USB device number 46 using dwc_otg
[ 1711.693976] usb 1-1.2: New USB device found, idVendor=090c, idProduct=1000
[ 1711.694007] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1711.694025] usb 1-1.2: Product: USB Flash Disk
[ 1711.694041] usb 1-1.2: Manufacturer: General
[ 1711.694058] usb 1-1.2: SerialNumber: 0107000000011210
[ 1711.695898] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 1711.696514] scsi host9: usb-storage 1-1.2:1.0
[ 1712.738232] ieee80211 phy6: rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x0008, type=2
[ 1712.738810] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.738810]
[ 1712.748414] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.748414]
[ 1712.748456] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.748456]
[ 1712.748493] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.748493]
[ 1712.748549] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.748549]
[ 1712.748664] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
[ 1712.748664]
[ 1712.788536] usb 1-1: USB disconnect, device number 39
[ 1712.788563] usb 1-1.1: USB disconnect, device number 40
[ 1712.788851] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet
[ 1712.788919] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 1712.834183] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.849322] usb 1-1.2: USB disconnect, device number 46
[ 1712.851093] usb 1-1.3: USB disconnect, device number 41
[ 1712.857125] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.863743] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.868764] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.871981] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.881372] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.889661] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260609: comm transmission-da: reading directory lblock 0
[ 1712.890923] wlan0: deauthenticating from 64:66:b3:14:6f:de by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1712.899551] EXT4-fs error (device sdd1): ext4_find_entry:1289: inode #260639: comm transmission-da: reading directory lblock 0
I also have problems occasionally with my USB WLAN adapter. Is it hardware issue with my USB or the Raspberry Pi, or is it just a software problem?
You might be getting powerspikes. If you're using a 0.7 A adapter you should change to a 1 A instead. Because, while the Raspberry Pi can survive on 0.7 A, it will have a hard time sustaining your USB adapters.

mkfs ext4 failing on Azure VM

I have a VM running CenOS 6.3 on Azure. I'm following the steps in the Microsoft article to attach a disk (article).
When I run: sudo mkfs -t ext4 /dev/sdc1
the process hangs indefinitely at "Writing superblocks and filesystem accounting information"
If I start a new session and try mounting the partition it says:
"mount: you must specify the filesystem type"
I've upgraded and downgraded my VM in order to force a hardware switch. I've detached and re-attached new disks of various sizes. Same result each time.
I'm guessing it must be either an error or setting on my OS that is causing the problem. Below is a full bash session. Any help would be very much appreciated!
[apper#apper ~]$ sudo grep SCSI /var/log/messages
Apr 19 14:08:47 apper kernel: sd 3:0:0:0: [sdc] Attached SCSI disk
Apr 19 14:19:38 apper kernel: sd 3:0:0:0: [sdc] Synchronizing SCSI cache
Apr 19 14:22:58 apper kernel: SCSI subsystem initialized
Apr 19 14:22:58 apper kernel: Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
Apr 19 14:22:58 apper kernel: sd 1:0:1:0: [sdb] Attached SCSI disk
Apr 19 14:22:58 apper kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Apr 19 14:33:08 apper kernel: sd 3:0:0:0: [sdc] Attached SCSI disk
Apr 19 14:40:16 apper kernel: sd 3:0:0:0: [sdc] Synchronizing SCSI cache
Apr 19 14:47:11 apper kernel: SCSI subsystem initialized
Apr 19 14:47:11 apper kernel: Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
Apr 19 14:47:11 apper kernel: sd 1:0:1:0: [sdb] Attached SCSI disk
Apr 19 14:47:11 apper kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Apr 19 14:48:40 apper kernel: sd 3:0:0:0: [sdc] Attached SCSI disk
[apper#apper ~]$ sudo fdisk /dev/sdc
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-32635, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-32635, default 32635):
Using default value 32635
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[apper#apper ~]$ sudo mkfs -t ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
16384000 inodes, 65535151 blocks
3276757 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
Try passing –E lazy_itable_init=1,lazy_journal_init=1 to mkfs.

BLKID not giving output in linux when run in file

I've written following script in linux to get USB detail: this script is executed from udev when usb is attached.
fgrep -A 15 'New USB device found' /var/log/messages | tail -n 16 > usb_detail
SERIAL=$(sed -n '5s/A.*: //p' usb_detail)
SIZE=$(sed -n '10s/A.*: //p' usb_detail)
MOUNT=$(sed -n '14s/A.*: //p' usb_detail)
blkid > Label
LABEL=$(grep $MOUNT Label | awk '{print $2}')
Now problem is that I'm getting all values (Serial No, Size, Mount on) but when it goes to check lable of usb from BLKID then i get nothing. this command gives me nothing in output:
blkid > Label
this command is working properly in command prompt. but when i run it in this script (which is called from UDEV when usb is attached) then it doesn't give any output.
So how can i figure out that what is main problem and why I'm not getting anything in LABEL file?
Here is my /var/log/messages:
Apr 28 08:25:58 box2 kernel: usb 1-3: New USB device found, idVendor=0411, idProduct=0105
Apr 28 08:25:58 box2 kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Apr 28 08:25:58 box2 kernel: usb 1-3: Product: USB-SATA Bridge
Apr 28 08:25:58 box2 kernel: usb 1-3: Manufacturer: BUFFALO
Apr 28 08:25:58 box2 kernel: usb 1-3: SerialNumber: 00001412AA38
Apr 28 08:25:58 box2 kernel: usb 1-3: configuration #1 chosen from 1 choice
Apr 28 08:25:58 box2 kernel: scsi25 : SCSI emulation for USB Mass Storage devices
Apr 28 08:26:05 box2 kernel: scsi 25:0:0:0: Direct-Access BUFFALO External HDD PQ: 0 ANSI: 2 CCS
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: Attached scsi generic sg0 type 0
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] Write Protect is off
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] Assuming drive cache: write through
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] Assuming drive cache: write through
Apr 28 08:26:05 box2 kernel: sda: sda1
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] Assuming drive cache: write through
Apr 28 08:26:05 box2 kernel: sd 25:0:0:0: [sda] Attached SCSI disk
and here is blkid output from command prompt:
[root#box2 usbmon]# blkid
/dev/sdf1: UUID="2d1bd58e-86ea-4ab2-99e3-ec2d1fb24021" TYPE="ext4"
/dev/sdf2: UUID="Je95wE-NW7f-Mqlv-UBgi-qNOL-8i35-8cUUTj" TYPE="LVM2_member"
/dev/mapper/vg_box2-lv_root: UUID="27cf24f7-4e7d-42bd-97be-09ddc6eb614b" TYPE="ext4"
/dev/mapper/vg_box2-lv_swap: UUID="36c54ea3-f9f3-455a-9c84-58e7317d1e60" TYPE="swap"
/dev/mapper/vg_box2-lv_home: UUID="5cac0192-2757-4cf6-b70f-d9ff8fbe6f36" TYPE="ext4"
/dev/sda1: LABEL="BU5" UUID="242DB177461FD69A" TYPE="ntfs"
Running with sudo will give you proper out.
sudo blkid
i fixed the issue by changing syntax
blkid > Label
to
/sbin/blkid > Label
dont know why but sometimes it works.

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window.
Recently a user was executing the application for a while and it died mysteriously. The text:
Killed
was on the terminal. This happened two times. I asked if someone at a different Terminal used the kill command to kill the process? No.
Under what conditions would Linux decide to kill my process? I believe the shell displayed "killed" because the process died after receiving the kill(9) signal. If Linux sent the kill signal should there be a message in a system log somewhere that explains why it was killed?
If the user or sysadmin did not kill the program the kernel may have. The kernel would only kill a process under exceptional circumstances such as extreme resource starvation (think mem+swap exhaustion).
Try:
dmesg -T| grep -E -i -B100 'killed process'
Where -B100 signifies the number of lines before the kill happened.
Omit -T on Mac OS.
This looks like a good article on the subject: Taming the OOM killer (1).
The gist is that Linux overcommits memory. When a process asks for more space, Linux will give it that space, even if it is claimed by another process, under the assumption that nobody actually uses all of the memory they ask for. The process will get exclusive use of the memory it has allocated when it actually uses it, not when it asks for it. This makes allocation quick, and might allow you to "cheat" and allocate more memory than you really have. However, once processes start using this memory, Linux might realize that it has been too generous in allocating memory it doesn't have, and will have to kill off a process to free some up. The process to be killed is based on a score taking into account runtime (long-running processes are safer), memory usage (greedy processes are less safe), and a few other factors, including a value you can adjust to make a process less likely to be killed. It's all described in the article in a lot more detail.
Edit: And here is [another article] (2) that explains pretty well how a process is chosen (annotated with some kernel code examples). The great thing about this is that it includes some commentary on the reasoning behind the various badness() rules.
Let me first explain when and why OOMKiller get invoked?
Say you have 512 RAM + 1GB Swap memory. So in theory, your CPU has access to total of 1.5GB of virtual memory.
Now, for some time everything is running fine within 1.5GB of total memory. But all of sudden (or gradually) your system has started consuming more and more memory and it reached at a point around 95% of total memory used.
Now say any process has requested large chunck of memory from the kernel. Kernel check for the available memory and find that there is no way it can allocate your process more memory. So it will try to free some memory calling/invoking OOMKiller (http://linux-mm.org/OOM).
OOMKiller has its own algorithm to score the rank for every process. Typically which process uses more memory becomes the victim to be killed.
Where can I find logs of OOMKiller?
Typically in /var/log directory. Either /var/log/kern.log or /var/log/dmesg
Hope this will help you.
Some typical solutions:
Increase memory (not swap)
Find the memory leaks in your program and fix them
Restrict memory any process can consume (for example JVM memory can be restricted using JAVA_OPTS)
See the logs and google :)
This is the Linux out of memory manager (OOM). Your process was selected due to 'badness' - a combination of recentness, resident size (memory in use, rather than just allocated) and other factors.
sudo journalctl -xb
You'll see a message like:
Jul 20 11:05:00 someapp kernel: Mem-Info:
Jul 20 11:05:00 someapp kernel: Node 0 DMA per-cpu:
Jul 20 11:05:00 someapp kernel: CPU 0: hi: 0, btch: 1 usd: 0
Jul 20 11:05:00 someapp kernel: Node 0 DMA32 per-cpu:
Jul 20 11:05:00 someapp kernel: CPU 0: hi: 186, btch: 31 usd: 30
Jul 20 11:05:00 someapp kernel: active_anon:206043 inactive_anon:6347 isolated_anon:0
active_file:722 inactive_file:4126 isolated_file:0
unevictable:0 dirty:5 writeback:0 unstable:0
free:12202 slab_reclaimable:3849 slab_unreclaimable:14574
mapped:792 shmem:12802 pagetables:1651 bounce:0
free_cma:0
Jul 20 11:05:00 someapp kernel: Node 0 DMA free:4576kB min:708kB low:884kB high:1060kB active_anon:10012kB inactive_anon:488kB active_file:4kB inactive_file:4kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present
Jul 20 11:05:00 someapp kernel: lowmem_reserve[]: 0 968 968 968
Jul 20 11:05:00 someapp kernel: Node 0 DMA32 free:44232kB min:44344kB low:55428kB high:66516kB active_anon:814160kB inactive_anon:24900kB active_file:2884kB inactive_file:16500kB unevictable:0kB isolated(anon):0kB isolated
Jul 20 11:05:00 someapp kernel: lowmem_reserve[]: 0 0 0 0
Jul 20 11:05:00 someapp kernel: Node 0 DMA: 17*4kB (UEM) 22*8kB (UEM) 15*16kB (UEM) 12*32kB (UEM) 8*64kB (E) 9*128kB (UEM) 2*256kB (UE) 3*512kB (UM) 0*1024kB 0*2048kB 0*4096kB = 4580kB
Jul 20 11:05:00 someapp kernel: Node 0 DMA32: 216*4kB (UE) 601*8kB (UE) 448*16kB (UE) 311*32kB (UEM) 135*64kB (UEM) 74*128kB (UEM) 5*256kB (EM) 0*512kB 0*1024kB 1*2048kB (R) 0*4096kB = 44232kB
Jul 20 11:05:00 someapp kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Jul 20 11:05:00 someapp kernel: 17656 total pagecache pages
Jul 20 11:05:00 someapp kernel: 0 pages in swap cache
Jul 20 11:05:00 someapp kernel: Swap cache stats: add 0, delete 0, find 0/0
Jul 20 11:05:00 someapp kernel: Free swap = 0kB
Jul 20 11:05:00 someapp kernel: Total swap = 0kB
Jul 20 11:05:00 someapp kernel: 262141 pages RAM
Jul 20 11:05:00 someapp kernel: 7645 pages reserved
Jul 20 11:05:00 someapp kernel: 264073 pages shared
Jul 20 11:05:00 someapp kernel: 240240 pages non-shared
Jul 20 11:05:00 someapp kernel: [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
Jul 20 11:05:00 someapp kernel: [ 241] 0 241 13581 1610 26 0 0 systemd-journal
Jul 20 11:05:00 someapp kernel: [ 246] 0 246 10494 133 22 0 -1000 systemd-udevd
Jul 20 11:05:00 someapp kernel: [ 264] 0 264 29174 121 26 0 -1000 auditd
Jul 20 11:05:00 someapp kernel: [ 342] 0 342 94449 466 67 0 0 NetworkManager
Jul 20 11:05:00 someapp kernel: [ 346] 0 346 137495 3125 88 0 0 tuned
Jul 20 11:05:00 someapp kernel: [ 348] 0 348 79595 726 60 0 0 rsyslogd
Jul 20 11:05:00 someapp kernel: [ 353] 70 353 6986 72 19 0 0 avahi-daemon
Jul 20 11:05:00 someapp kernel: [ 362] 70 362 6986 58 18 0 0 avahi-daemon
Jul 20 11:05:00 someapp kernel: [ 378] 0 378 1621 25 8 0 0 iprinit
Jul 20 11:05:00 someapp kernel: [ 380] 0 380 1621 26 9 0 0 iprupdate
Jul 20 11:05:00 someapp kernel: [ 384] 81 384 6676 142 18 0 -900 dbus-daemon
Jul 20 11:05:00 someapp kernel: [ 385] 0 385 8671 83 21 0 0 systemd-logind
Jul 20 11:05:00 someapp kernel: [ 386] 0 386 31573 153 15 0 0 crond
Jul 20 11:05:00 someapp kernel: [ 391] 999 391 128531 2440 48 0 0 polkitd
Jul 20 11:05:00 someapp kernel: [ 400] 0 400 9781 23 8 0 0 iprdump
Jul 20 11:05:00 someapp kernel: [ 419] 0 419 27501 32 10 0 0 agetty
Jul 20 11:05:00 someapp kernel: [ 855] 0 855 22883 258 43 0 0 master
Jul 20 11:05:00 someapp kernel: [ 862] 89 862 22926 254 44 0 0 qmgr
Jul 20 11:05:00 someapp kernel: [23631] 0 23631 20698 211 43 0 -1000 sshd
Jul 20 11:05:00 someapp kernel: [12884] 0 12884 81885 3754 80 0 0 firewalld
Jul 20 11:05:00 someapp kernel: [18130] 0 18130 33359 291 65 0 0 sshd
Jul 20 11:05:00 someapp kernel: [18132] 1000 18132 33791 748 64 0 0 sshd
Jul 20 11:05:00 someapp kernel: [18133] 1000 18133 28867 122 13 0 0 bash
Jul 20 11:05:00 someapp kernel: [18428] 99 18428 208627 42909 151 0 0 node
Jul 20 11:05:00 someapp kernel: [18486] 89 18486 22909 250 46 0 0 pickup
Jul 20 11:05:00 someapp kernel: [18515] 1000 18515 352905 141851 470 0 0 npm
Jul 20 11:05:00 someapp kernel: [18520] 0 18520 33359 291 66 0 0 sshd
Jul 20 11:05:00 someapp kernel: [18522] 1000 18522 33359 294 64 0 0 sshd
Jul 20 11:05:00 someapp kernel: [18523] 1000 18523 28866 115 12 0 0 bash
Jul 20 11:05:00 someapp kernel: Out of memory: Kill process 18515 (npm) score 559 or sacrifice child
Jul 20 11:05:00 someapp kernel: Killed process 18515 (npm) total-vm:1411620kB, anon-rss:567404kB, file-rss:0kB
As dwc and Adam Jaskiewicz have stated, the culprit is likely the OOM Killer. However, the next question that follows is: How do I prevent this?
There are several ways:
Give your system more RAM if you can (easy if its a VM)
Make sure the OOM killer chooses a different process.
Disable the OOM Killer
Choose a Linux distro which ships with the OOM Killer disabled.
I found (2) to be especially easy to implement:
Adjust /proc/<PID>/oom_score_adj to -1000 (which automatically takes oom_adj to -17 and oom_score to 0).
See how To Create OOM Exclusions in Linux for more.
A tool like systemtap (or a tracer) can monitor kernel signal-transmission logic and report. e.g., https://sourceware.org/systemtap/examples/process/sigmon.stp
# stap --example sigmon.stp -x 31994 SIGKILL
SPID SNAME RPID RNAME SIGNUM SIGNAME
5609 bash 31994 find 9 SIGKILL
The filtering if block in that script can be adjusted to taste, or eliminated to trace systemwide signal traffic. Causes can be further isolated by collecting backtraces (add a print_backtrace() and/or print_ubacktrace() to the probe, for kernel- and userspace- respectively).
The PAM module to limit resources caused exactly the results you described: My process died mysteriously with the text Killed on the console window. No log output, neither in syslog nor in kern.log. The top program helped me to discover that exactly after one minute of CPU usage my process gets killed.
In an lsf environment (interactive or otherwise) if the application exceeds memory utilization beyond some preset threshold by the admins on the queue or the resource request in submit to the queue the processes will be killed so other users don't fall victim to a potential run away. It doesn't always send an email when it does so, depending on how its set up.
One solution in this case is to find a queue with larger resources or define larger resource requirements in the submission.
You may also want to review man ulimit
Although I don't remember ulimit resulting in Killed its been a while since I needed that.
In my case this was happening with a Laravel queue worker. The system logs did not mention any killing so I looked further and it turned out that the worker was basically killing itself because of a job that exceeded the memory limit (which is set to 128M by default).
Running the queue worker with --timeout=600 and --memory=1024 fixed the problem for me.
We have had recurring problems under Linux at a customer site (Red Hat, I think), with OOMKiller (out-of-memory killer) killing both our principle application (i.e. the reason the server exists) and it's data base processes.
In each case OOMKiller simply decided that the processes were using to much resources... the machine wasn't even about to fail for lack of resources. Neither the application nor it's database has problems with memory leaks (or any other resource leak).
I am not a Linux expert, but I rather gathered it's algorithm for deciding when to kill something and what to kill is complex. Also, I was told (I can't speak as to the accuracy of this) that OOMKiller is baked into the Kernel and you can't simply not run it.
The user has the ability to kill his own programs, using kill or Control+C, but I get the impression that's not what happened, and that the user complained to you.
root has the ability to kill programs of course, but if someone has root on your machine and is killing stuff you have bigger problems.
If you are not the sysadmin, the sysadmin may have set up quotas on CPU, RAM, ort disk usage and auto-kills processes that exceed them.
Other than those guesses, I'm not sure without more info about the program.
I encountered this problem lately. Finally, I found my processes were killed just after Opensuse zypper update was called automatically. To disable zypper update solved my problem.

Resources