Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: USB drives switch off after a while

  1. #11
    Join Date
    Apr 2021
    Beans
    5

    Re: USB drives switch off after a while

    should I create this folder?
    No. Execute

    sudo smartctl --xall /dev/sdb

    while these drives are connected and accessible.

    Do the problems disappear after you plug out and then plug in these drives? Do you need to restart the laptop to use these drives again?

  2. #12
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    When I unplug the devices and plug them back in, they don't work. Only after rebooting the laptop are the drives available again

  3. #13
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Quote Originally Posted by phile-mitti99 View Post
    Hey,

    I can try these commands,
    but when I do 'sudo smartctl --xall / dev / sdb'enter see' this directory was not found '.
    Please learn to use command completion or tab completion in the shell. It is easy and will prevent ever getting the wrong file or directory name again. Forever. Look for a youtube video on it - since it is easy to explain in a video, but hard to explain clearly in text. 10 seconds and you are a master.
    Basically, if you are typing more than 2-3 characters at a time, then you are doing it wrong.

    I didn't look at anything other than the /dev/sd {whatever} part.

    For more shell efficiencies: https://github.com/jlevy/the-art-of-command-line
    Don't worry about knowing or understanding all of them. Skim everything and use what makes sense. Every 3-6 months (set a calendar entry), come back and re-skim it again. More things will make sense and you'll be more efficient. I'm more efficient with a shell in a terminal than using a mouse for almost everything. My brain thinks in a specific way to minimize typing, but still do what I want. File/directory "globbing" is very powerful. But some commands, like smartctl won't use globbed filenames that expand into more than 1 input at a time.

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    And for commands you don't know, please, please, please, review the manpage for it. Every command on Unix-like systems has a manual page which explains all the options and inputs and outputs and how those can be formatted. There are caveats for when it doesn't work as expected and perhaps pitfalls. Administrator commands like hdparm and smartctl each have manpages that need to be read to ensure we don't do damage.

  5. #15
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    For me there is no directory with /etc/sdb. I can write /etc/s and press tab, but it doesn't suggest the file sdb and when I enter /etc/sdb an error occurs because I don't have this file.


    Smartctl open device: /dev/sdb failed: No such device

    Does this file not exist because of my errors because of the USB?

  6. #16
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Quote Originally Posted by phile-mitti99 View Post
    For me there is no directory with /etc/sdb. I can write /etc/s and press tab, but it doesn't suggest the file sdb and when I enter /etc/sdb an error occurs because I don't have this file.


    Smartctl open device: /dev/sdb failed: No such device

    Does this file not exist because of my errors because of the USB?
    Well, /etc/ is wrong. Disk storage device files are under /dev/. And just to be clear - I've made exactly the same mistake, but I know when tab-completion "bonks" at me, it means the file doesn't exist, so I need to re-check my inputs. Also, each tool should come with a bash-completion update so ensure different inputs that are order-specific as options cannot be entered in the wrong order.

  7. #17
    Join Date
    Apr 2021
    Beans
    5

    Re: USB drives switch off after a while

    When I unplug the devices and plug them back in, they don't work. Only after rebooting the laptop are the drives available again
    This is strange. Could you provide the kernel log from this laptop? It could be obtained by typing "dmesg" in the terminal. Do:
    Code:
    dmesg > dmesg_2020-04-06.txt
    This will cause the output of the dmesg command to be stored in a file called "dmesg_2020-04-06.txt". The ">" char instructs a redirection.

    Please provide the kernel log after all the following: the drive stops working, you plug it out and then in.
    This file can be attached in advanced editor on this forum - there is an icon in the top row.

  8. #18
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: USB drives switch off after a while

    Code:
    dmesg -w
    will show the "tail" of the file, in real-time.
    If you want to save it to a file, use
    Code:
    $ dmesg -w | tee /tmp/log.dmesg
    
    [884072.532135] usb 2-3: USB disconnect, device number 5
    [884078.957120] usb 2-3: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
    [884078.984199] usb 2-3: New USB device found, idVendor=11b0, idProduct=3307, bcdDevice=0.13
    [884078.984203] usb 2-3: New USB device strings: Mfr=3, Product=4, SerialNumber=2
    [884078.984205] usb 2-3: Product: UHSII uSD Reader
    [884078.984207] usb 2-3: Manufacturer: Kingston
    [884078.984209] usb 2-3: SerialNumber: 000000000013
    [884078.991763] usb-storage 2-3:1.0: USB Mass Storage device detected
    [884078.991936] scsi host16: usb-storage 2-3:1.0
    [884080.002716] scsi 16:0:0:0: Direct-Access     Kingston UHSII uSD Reader 0013 PQ: 0 ANSI: 6
    [884080.003249] sd 16:0:0:0: Attached scsi generic sg2 type 0
    [884080.394000] sd 16:0:0:0: [sdc] Spinning up disk...
    [884081.408185] .ready
    [884081.770634] sd 16:0:0:0: [sdc] 15954944 512-byte logical blocks: (8.17 GB/7.61 GiB)
    [884081.771436] sd 16:0:0:0: [sdc] Write Protect is off
    [884081.771438] sd 16:0:0:0: [sdc] Mode Sense: 21 00 00 00
    [884081.772213] sd 16:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
    [884081.804506]  sdc: sdc1
    [884081.807440] sd 16:0:0:0: [sdc] Attached SCSI removable disk
    [884089.400357] usb 2-3: USB disconnect, device number 6
    That example shows a USB3 converter with a microSD being removed, inserted and removed.
    The log.dmesg will have much more of dmesg output than we expect. Jump to the bottom, but in the terminal, just the last few lines are displayed.

  9. #19
    Join Date
    Apr 2021
    Beans
    13

    Post Re: USB drives switch off after a while

    Code:
    [  946.626629] usb 2-2: USB disconnect, device number 2
    [  953.368668] usb 2-2: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd[  953.390642] usb 2-2: New USB device found, idVendor=0480, idProduct=0900, bcdDevice= 3.15
    [  953.390646] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  953.390648] usb 2-2: Product: External USB 3.0
    [  953.390650] usb 2-2: Manufacturer: TOSHIBA
    [  953.390651] usb 2-2: SerialNumber: 20200824007277F
    [  953.391697] usb-storage 2-2:1.0: USB Mass Storage device detected
    if my USB works it is as it should be. if the USB drives turn off I can do that again and send a piece of CODE.

  10. #20
    Join Date
    Apr 2021
    Beans
    13

    Re: USB drives switch off after a while

    My USB drives have switched off and I have written dmesg -w, when I unplug a device it does not log anything

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •