Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

harddisk is dying... help!

Discussion in 'Data Protection' started by Divvy, Dec 9, 2011.

  1. Divvy

    Divvy Member

    Jul 10, 2005
    Likes Received:
    Trophy Points:
    Hello guys,

    Can someone please help me?

    This month I'm receiving too many emails with notifications from my server about CPU overload.
    Today I contacted WorldStream and they said that:

    Can someone please teach me how to make a full backup of all my accounts? I only know how to make scheduled backups...
    What is the best way?

    Note: This morning I made a cpanel backup of a single account, and after 12h, I received the email saying that backup is complete... and I got many lines like that:
    This was just for one account... I have many of them... how long will take the backup? one month? :(

    Please help me...
    Thank you!

  2. minosjl

    minosjl Well-Known Member

    Jun 4, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    If you have configured your WHM backup previously , you can get the backup by manually running the script " /usr/local/cpanel/scripts/cpbackup " in the shell at you convenient time, where the server load is low

    You can also make a full backup by making a list of your domains and put in in a for loop for account backup.

    for x in `ls /var/cpanel/users` ; do /scripts/pkgacct $x ; done
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. quietFinn

    quietFinn Well-Known Member

    Feb 4, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Do you have 2nd HD for the backups?
    If not then it's the 1st thing you need to do: get the 2nd HD.
    When you have it, mount it as /backup
    and configure backups in
    WHM-> Backup-> Configure Backup

    When you have full backups of all accounts you can ask your host to replace the 1st HD, install OS & cPanel and then retore all the accounts from backups in the 2nd HD.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Drake

    Drake Well-Known Member

    Nov 9, 2001
    Likes Received:
    Trophy Points:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hello Divvy,

    Maybe I'm reading your "dying hard drive" issue wrong.

    At quick glance it seems like something else might be wrong with heavy cpu usage.

    [Here's my edit, after the fact]

    After I wrote the reply, i saw you said your hard drive's SMART was failing.

    If that is the case, then the hard drive should be changed out.

    However, still keep the old SMART-failed hard drive locked away as I explain the reason below.

    After you replace your drive, I'd recommend to keep an eye on the CPU usage for a while anyhow.

    There's a possibility that you have 2 separate coincidental issues happening at one time.

    Hopefully my reply was not a waste of our time and can help you in some way
    or can help somebody else with an issue in the future.

    [End of my edit]

    I have a walk-through for cloning a server single hard drive that I wrote for someone that I'll include below in hopes it can be of assistance.

    CPU overload doesn't have to mean a hard drive going south. I assume you're Linux, not Windows. Have you logged in via ssh and checked on the processes running? Run the command top and take a look at what's consuming the most CPU, memory and of course what processes keep running the longest. Usually, either "top" or "mem" will be the same command (an alias). Top is a real time display, so watch for a few minutes and get a feel for what processes are really pulling CPU (and for how long). The most intensive processes will be toward the top. You should see the most intensive processes alternating as they utilize resources, memory, and view the cpu usage percent. Also take into consideration if you have any specific process that is staying up at the top (in the "top" command output) and view their CPU %. Control+C will exit "top" Consider suspicious any processes staying up top that should be low resource processes.

    I would also try (a few times, several minutes apart) doing a "ps auxx" (no quotes) and scroll back, examining the CPU usage column. The ps command, will have the oldest process PID's at the top and newest at the bottom. ps is a only a snapshot at that moment, not real-time like top or mem. That is why I would do it a few times.

    Additionally, if you see any processes by name that you don't recognize, be wary of them and investigate further. This goes for both the top and the "ps auxx" commands. If you see any weird process names that you don't recognize, don't try to kill it, until know what it is. Google or yahoo search the name of a suspicious process to learn what it is.

    FYI: "top" (mem) and ps auxx (or ps something-else) only display info, as opposed to "kill -9 something" is an active command that does something.

    Definitely get your accounts backed up. In my opinion should be done automatically daily, weekly, and monthly via cPanel backup utility. If you're using some form of CDP continuous data backup instead of, or in addition to cPanel's backup, you're safer yet, because you'd likely have the option to be backing up the entire operating system (whereas Cpanel backup only backs up the accounts).

    And if you really do have a failing hard drive, How old is the hard drive? I get the idea you are using single hard drive(s) (I presume it's not a RAID array or you wouldn't be posting this post in a hurry; you'd be either hot-swapping the bad drive to replace the hot spare that went in service, or if not hot swap, you'd power down and replace the failed RAID member drive.)

    I don't need the answer. Just ask yourself that question.

    But as a analogy, keep in mind that even a brand new light bulb or car tire could fail on the first day.

    Here's a fast suggestion if you think the drive is going to die. Grab a new hard drive, the same exact size and go clone it. Exact same size or larger depends on what method below you choose.

    Try to use enterprise grade hard drives even at the added cost. But in an emergency even a used hard drive can save you.

    Some factors also depend on your server, if you have a CD rom, and motherboard ports to plug in a new drive.

    If you don't have provisions for CD and another hard drive connector on the motherboard, you can always pull your drive out and use another computer to do the cloning procedure.

    You'll have to take the machine off line for a while. You can actually copy a whole hard drive exactly. Eide, SATA, SCSI not a problem. Add the new drive, then with ethernet unplugged, boot with your choice of CD based Linux self-contained systems.

    If you pull your drive to use another machine to clone, and that new machine is a linux machine, you can use its own Linux O.S. to do the clone then you may run into issues where the other machine recognizes the extra drives and mounts them.

    You can use a commercially available drive imaging and cloning software, open source ones, or monkey around with commands like dd. I nicknamed dd as double-dangerous the first time I used it.

    Unless you have grown to prefer one way or another, then a relatively new or newest version of commercially available cloning software is the least likely to cause you problems. Depending on the product you use, you can clone to different size drives, adjust partition sizes, and see a GUI display of which drive you're coying onto the replacement (to be sure you're not cloning a blank drive over your valuable data).

    PLEASE: Whatever method you use for cloning your hard drive, or replacing it, at least do a cpanel full backup first. In the event you have a catastrophe while replacing or cloning, you'll still have your accounts.

    I don't know how much room you have or if you're crammed into a crowded rack somewhere, but I doubt it you're going to be doing this drive replacement 7 cloning/copying in-rack. I take the macjine over to a work bench and do it so i have room.

    And if you only have a small 1-U server with no extra room to set drives inside, then temporarily hang the extra backup drive over on the side, top, wherever. If any of these hard drives are going to be temporarily hung, set, or laid on top of something, be sure the exposed circuit board on the underside of any hard drives doesn't touch any other metal stuff. In a pinch, I've even used cardboard or styrofoam when the only available position would have caused metallic contact to the underside circuit board.

    If you don't want to use a commercial product, the following is an old favorite that I grew to like.

    Knoppix can be downloaded as a .iso and burned to a CD. It's not huge either. I personally like to use Knoppix for this procedure when replicating drive to same size drive. Once booted and running on Knoppix, you will need to open a terminal window, then su to root and copy the old drive to the new one. You are actually copying the whole drive, not individual partitions. You would issue the command cp /dev/sda /dev/sdb (those are arbitrary drive names) Then it will ask you to verify for sure. Warning: I can't stress this enough. It is important to know which drive is which. You absolutely need to cp your data drive to your new replacement. If you mistakenly cp your blank replacement drive to your data drive, then you will have overwritten your data drive with blankness. After complete, install the new hard drive into the came motherboard connection as your old drive was. This procedure only works right if you are using the same size drive as a replacement. If your replacement is too small, the procedure will bomb out.

    If its a bigger drive, then the data will expand to fill it. Time wise, a 250 gig hard drive will take a little over an hour to cp, depending on your machine's speed. During that 1+ hours while doing a cp current drive to replacement drive, the command will just sit there and look like it's doing nothing. There is no progress indicator like cloning software. About all you can do is open another terminal screen and issue the 'top" command and you will see the 'cp" up at the top the whole time.

    I've wasted enough of your time already. So, good luck with your server.

    And, if you replace the hard drive, keep the old one (secure it, as other people's private data is on there), but keep it because, remember even a brand new light bulb or car tire can fail the first day.

    I hope to have been of some help to you or another reader in the future.

    Drake Pallister
    Duraserver Tech.

    Thought of the day: If your older hardware raid controller card doesn't have a mini battery backup, consider turning off write-caching. Consult the owners manual or Google/Yahoo the potential for data loss. Something important to the O.S. might be in that cache when a power loss happens. I'm not convinced by the benchmark tests that there is an intolerable noticaeble
    performance reduction. Especially not noticeable through the Internet and into someone's PC browser.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 Drake, Dec 11, 2011
    Last edited by a moderator: Dec 12, 2011
  5. ring7

    ring7 Registered

    Feb 13, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Reseller Owner
    just come and see, learn

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice