Find the answer to your Linux question:
Results 1 to 9 of 9
Hello all, I inherited a debian squeeze node with a simple LAMP stack installed. The backup 'solution' they set up is a simple USB disk hooked onto the server with ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2012
    Posts
    4

    Question USB disconnects during backup


    Hello all,
    I inherited a debian squeeze node with a simple LAMP stack installed. The backup 'solution' they set up is a simple USB disk hooked onto the server with a LUKS+ext4 partition. Previously the files were simply tar-d together and copied to the disk, now I use rdiff-backup instead.

    The problem is, that the disk randomly disconnects during backup. After the disk is gone, only a hard-reboot helps. Until that, the disk is not mountable again.
    According to SMART, there are no errors, everything seems to be fine.
    The node is in a remote DC, so physical inspection is not really possible.
    It seems, that the tar solution worked, but rdiff-backup kills the connection.
    Any ideas what causes this?

    HW:
    Intel Server Board S5520HC,
    Xeon E5620,
    6G DDR3 ECC ram,
    Intel Server Chassis SC5650DP,
    a handfull of SAS disks

  2. #2
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    902
    Saw a almost idential post on another site, but no solution. They were saying the external drive during backup get unmounted and remounted, but looks like it remounts read-only. That might generate and drive problem, if a problem on an external drive the kernel will unmount the drive.

    Have you looks through your logs for error messages?

  3. #3
    Just Joined!
    Join Date
    May 2012
    Posts
    4
    Yes, i've checked the logs, but there are no errors at all. In dmesg suddenly there is a USB disconnect message, and the whole thing dies. After the disconnect there are a lot of errors from hung tasks, mainly the USB subsystem, but there are none before the disconnect.

  4. #4
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    627
    Quote Originally Posted by vadito View Post
    Hello all,
    I inherited a debian squeeze node with a simple LAMP stack installed. The backup 'solution' they set up is a simple USB disk hooked onto the server with a LUKS+ext4 partition. Previously the files were simply tar-d together and copied to the disk, now I use rdiff-backup instead.

    The problem is, that the disk randomly disconnects during backup. After the disk is gone, only a hard-reboot helps. Until that, the disk is not mountable again.
    According to SMART, there are no errors, everything seems to be fine.
    The node is in a remote DC, so physical inspection is not really possible.
    It seems, that the tar solution worked, but rdiff-backup kills the connection.
    Any ideas what causes this?

    HW:
    Intel Server Board S5520HC,
    Xeon E5620,
    6G DDR3 ECC ram,
    Intel Server Chassis SC5650DP,
    a handfull of SAS disks
    I bought a 2TB Tobshiba external from Office Max and it disconects. I use this script which I start when I mount the drive and it keeps it from disconnecting.'
    Code:
    #!/bin/bash
    #
    
    UUID="${1}"
    interval="${2:-10}"
    
    [ "${UUID#/dev/}" != "${UUID}" ] && UUID="$(info=($(ls -l /dev/disk/by-uuid/ | grep ${UUID#/dev/})); echo "${info[8]}")"
    
    SCREENNAME="keep_drive_awake_${UUID}"
    screen -wipe >/dev/null 2>/dev/null
    SCREEN_PID="$(info=( $(screen -ls | grep ${SCREENNAME} | sed 's=\.= =') ) ; echo "${info[0]}")"
    
    case "${0##*/}" in
        status*)
                    [ "${SCREEN_PID}" != "" ] && echo 'Ruunning' || echo 'Stopped'
        ;;
        start*)
                    [ "${SCREEN_PID}"  = "" ] && screen -dmS ${SCREENNAME} /usr/local/bin/keep_drive_awake "${UUID}" "${interval}" \
                                              || echo "Already Running"
        ;;
        stop*)
                    [ "${SCREEN_PID}" != "" ] && kill -9 ${SCREEN_PID} \
                                              || echo "Already Stopped"
    
        ;;
        show*)
                    screen -r ${SCREENNAME}
        ;;
    esac
    I pass in theuuid for the drive and a time period to look at the drive. I currently use the default of 10 seconds between looks and it keeps it awake even if unsed when mounted and not in use.

  5. #5
    Linux Newbie
    Join Date
    May 2012
    Posts
    115
    I don't know if its the same as happens to me but I think it is.. The problem on my drives is power... for some reason when I push too much on them they disconnect and when they connect again Debian can't use them and crashes... them I just restart and they start working again.

  6. #6
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    627
    The drive disconnects and the reconnection is "read-only" is what happens on the drive prior to my starting the background task that keeps the drive connected.

  7. #7
    Just Joined!
    Join Date
    Feb 2014
    Posts
    7
    Quote Originally Posted by vadito View Post
    Hello all,
    I inherited a debian squeeze node with a simple LAMP stack installed. The backup 'solution' they set up is a simple USB disk hooked onto the server with a LUKS+ext4 partition. Previously the files were simply tar-d together and copied to the disk, now I use rdiff-backup instead.

    The problem is, that the disk randomly disconnects during backup. After the disk is gone, only a hard-reboot helps. Until that, the disk is not mountable again.
    According to SMART, there are no errors, everything seems to be fine.
    The node is in a remote DC, so physical inspection is not really possible.
    It seems, that the tar solution worked, but rdiff-backup kills the connection.
    Any ideas what causes this?

    HW:
    Intel Server Board S5520HC,
    Xeon E5620,
    6G DDR3 ECC ram,
    Intel Server Chassis SC5650DP,
    a handfull of SAS disks
    However, I am not able to diagnose the exact place of problem but can viruses be the reason to all this? or any physical damage? Sorry if it sounds silly.

  8. #8
    Just Joined!
    Join Date
    May 2012
    Posts
    4
    I've modified my backup script. After mounting the partition, it starts a thread that touches a file on the disk every minute. Before unmount the task gets killed.
    It's stable since 5 days, will report back in a week or so, will see if it's going to be stable or not.
    Thank's all for the ideas.

  9. #9
    Just Joined!
    Join Date
    May 2012
    Posts
    4
    Currently the modified script is running stable, but I have another problems, so I can't be sure if it is now really fixed or not. The node dies randomly, so I can't run a countinuous test for weeks.
    The USB resets are gone now, so it seems that the "tickle the disk every minute" modification is working.

Posting Permissions

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