Results 1 to 10 of 10
  1. #1

    Question Retrieve data from 2nd HDD after server failed

    My server HDD got corrupted. My server provider mount a new HDD for me, and put the OLD HDD as secondary drive.

    This is what they emailed me:

    [[email protected] ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/hda3 149G 3.7G 138G 3% /
    /dev/hda1 99M 17M 77M 19% /boot
    none 498M 0 498M 0% /dev/shm
    /usr/tmpDSK 485M 13M 447M 3% /tmp
    /tmp 485M 13M 447M 3% /var/tmp
    /dev/hdc3 149G 23G 119G 16% /backup


    I have a forum data (files and database) that is still on the old HDD, I hope to retrieve it.

    May I know how can I access to the data?

    I tried SSH, can only go till /dev/, then don't know what to do.

    What is the command in SSH that I should type in order to go to the 2nd HDD? How can I retrieve the database and files to my new HDD?

    Please advice, really appreciate it.

    Many thanks in advance.
    www.ShaShinKi.com ~ Online Camera Shop!

  2. #2
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    mount /backup
    If you get an error saying it's already mounted:
    cd /backup
    Locate the backup files.
    mv ./backup* /home
    Then restore.
    Having problems, or maybe questions about WHT? Head over to the help desk!

  3. #3
    Looks like someone beat me to it, so I'm changing my answer, since it looks like the simple code has been provided. I say, always ask your provider first. Even when you think the solution may cost you money, most providers will provide simple INFO like this just to show you they appreciate you as a client and are real human beings who care.
    Last edited by sbray; 02-03-2008 at 08:49 AM.
    Shawn Bray
    Pinellas Hosting - www.pinellashosting.com
    Dedicated Servers | Collocation | Webhosting | Data Backup | Domain Registration

  4. #4
    Quote Originally Posted by bear View Post
    mount /backup
    If you get an error saying it's already mounted:
    cd /backup
    Locate the backup files.
    mv ./backup* /home
    Then restore.
    Thanks bear! Really appreciate it!

    Quote Originally Posted by sbray View Post
    Looks like someone beat me to it, so I'm changing my answer, since it looks like the simple code has been provided. I say, always ask your provider first. Even when you think the solution may cost you money, most providers will provide simple INFO like this just to show you they appreciate you as a client and are real human beings who care.
    My server is with layeredtech...it is an unmanaged server, so they don't help me with restoring backup stuff...

    I got another question.

    I have managed to located the files of my previous domain now (eg. /backup/home/username01/)

    However, how do I retrieve the database? I only have experience via phpAdmin in database configuration, I don't know exactly how and where to backup or now restore the database of my username01 above.
    www.ShaShinKi.com ~ Online Camera Shop!

  5. #5
    Join Date
    Jun 2002
    Location
    Toronto, Ontario
    Posts
    1,449
    If this is a cPanel server, you should be able to get the mySQL databases from /var/lib/mysql/yourusername_dbname
    Kaumil P.

  6. #6
    Hi VP-Kaumil,

    Thank you very much! Managed to copy the database.

    Regarding SSH command, what should I type if I want to copy everything in a directory (including subdirectories and files) to a new location?

    I tried (I am in the backup directory already):
    cp *.* /home/capkkk/public_html/

    but it only copy the files, not the directories inside it.
    www.ShaShinKi.com ~ Online Camera Shop!

  7. #7
    Nevermind, I found the command:

    cp -av * /home/capkkk/public_html/

    Another question. I have moved the database folder (not a zip file) to my new domain directory, how do I restore the database from the folder?
    www.ShaShinKi.com ~ Online Camera Shop!

  8. #8
    Join Date
    Aug 2004
    Posts
    616
    You need to copy your databases from the backup folder to the /var/lib/mysql directory on the new drive.

    Once you do that do a : ls -la and make sure the owner and group are both belonging to mysql and not root. If they are root use the commands chown and chgrp to change the permission.
    BGP GRID
    UNetLab Network Simulator Hosting
    Prepare for your CCNA/CCNP/CCIE certifications today!

  9. #9
    Join Date
    Nov 2002
    Location
    WebHostingTalk
    Posts
    8,878
    * Moved to Technical and Security Issues....

    Sirius
    I support the Human Rights Campaign!
    Moving to the Tampa, Florida area? Check out life in the suburbs in Trinity, Florida.

  10. #10
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Once you create the database, the folder /var/lib/mysql/dbname/ will be formed. Copy the contents from /home/capkkk/public_html/dbname/ to the new folder. Give necessary privileges to the database user from the control panel or from shell as follows.

    Type mysql to get into mysql prompt.
    mysql> grant all privileges on dbname.* to [email protected] identified by 'password';
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

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