Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Linux [Debian 8] How do you recover files and put it back the way it w

#Debian 8 system restore problems help

  • This topic is locked This topic is locked

#1
**Brian**

**Brian**

    Semper Paratus: Always Ready

  • Member
  • PipPipPipPip
  • 1,164 posts

Good Morning All:

 

[BACKGROUND]

 

I have been a DOS and Windows User for many years.  In 2008, I started using Debian Linux, and that was Debian 4.  Then I moved to Debian 5, and all was well.  In 2012, was running my server when it was disconnected, and then, removed from the Co-Location where I used to work,  In about 2015, I converted a old windows box to Debian 8 [JESSIE] and she had been working well, and I had all my programs installed and working well.  I would do backups of all of the directories (/) (/home) (/home2) (/home3) (/var) (/etc) and all of the support files for my blogs and forum in the /var/www/html)  I have all of these programs installed, and was able to get it to work well.

 

[THE THINGS I TRIED[

I have posted the following to ask for assistance:  (via: briteccomputers.co.uk)

 

 


 

Good Morning All:

Well, some of you here know that I run a Linux Server: I have been working on this server for about 3-4 years in my spare time, and I have received a LOT of good help from RIGHT HERE, and I am thankful for that assistance.

So, the problem: On April 12, the POWER SUPPLY in my server (cardinal) POPPED, and I was lucky that NO damage happened to the Drives in there. I have a 1 Terrabyte (/1TB) a 3 Terrabyte (/3TB) an 8 Terrabyte, (/8TB) and a 320 GIG (/320) mounted in the mix, and root (/) is running on a 288 GIG HDD, showing 29% USED.LVM I think smile.png

I had the machine serviced a couple weeks later, and the PSU was replaced with a brand new one - The machine fired, and it took me about 2 hours to get it set up right so that it would boot to User Level 3 (runlevel3) which allows for services to run.

So, Everything was working well, and then I go to work the next day, after a restart. I try a login from my work PC's, and I get NOTHING for a connection. So, I come home, and the machine is powered OFF. tried this several times, and each time, machine stays on for 4-5 HOURS, then BOOM, machine shuts down. So, I call my tech that serviced me, and she agreed that the PSU could be bad, so she orders another, and dispatches her Husband down here: He replaces the PSU, but tells me:



"You've Got 7 BULGING capacitors, and 2 LEAKING capacitors on that motherboard, Bud" So I have him change the drives and PSU to a different case, and and have him check the motherboard. She was not showing any damage. Machine was an HP, just a little older, and then when we power up, everything boots, but I had to go to rescue mode and command a "nano /etc/fstab" as root, checked the drives, and the mountpoints. Got that sorted, but:

4-5 HOURS later, we have a power OFF: my internal drive was moved along with the PSU, so that killed a bad PSU problem, but:

NOW: we have a problem:

I have a backup of all directories I need: (/, /root, /home, /home2, /home3, /home4, /var, /var/www, /etc) BUT these are files that are from Dec 31, 2018, and newer backups were attempted, but with the machine powering OFF: A root (/ ) (FULL) backup is IMPOSSIBLE, as the backup would not complete, and sometimes other directories would not work right either if the machine just powers down while attempting the backup.

What I did was:

1. root login to console, command "ping buddy-baker.us" and leave that running
2. brian login to thrush, command a 'su' to become root, check file systems, ALL seem OK
3. run cron that says PING my domain every 3.5 hours, so that the machine is NOT idle

OK, so that did not work. But I have a friend of mine that says "wait until Debian 10 comes out" He says that because he knows that the MySQL databases change format, and there would be no going back if something goes haywire if the conversion was done.

So I am SCRAPPING BOTH HP's: They were consumer level PC's and they are not really capable of running the sites like I want: SO, I approached my accountant, and he agreed that if I am going to be running a BUSINESS website as well, then he would be willing to authorize the purchase.

Today, I ordered THIS: (https://www.amazon.c...0?ie=UTF8&psc=1)

Being a business class computer, should be able to run what I need and at less stress on the processors, fans, PSU and the like.

so my question is: If you HAD to stay with Debian Jessie for now, and you DID NOT WANT to go to Debian 9, would you install the base file systems, and LVM the root and /boot and then just do a
 

tar -xvpzf "filename.tar.gz -C /

Which would then mostylikely restore Cardinal to his old self again....Or......would you just boot Netinst ISO, and follow the graphical Install, then make a Directory on the root called /recover, then drop every file there, and then restore each tar to the directory that you need?

I have worries about drivers and sources for Jessie, and I may have to grab files off the older machine as I work, but she just wont stay ON, and sometimes wont BOOT right either!

Thoughts??

Brian

[/quote]

 

[WHAT I NEED]

 

I seem to be having a few problems.  If I issue the command: 

'tar -xvpzf "filename.tar.gz -C /

What happens is that the file that has the FULL backup starts to delete the NEWLY installed FS, and tries to install the  filesystem of the old system, which has mountpoints and all that jazz,  When it does this, I tried doing it, and soon, I had NO bin files such as Finger, ls, df, du, and I had NOTHING in any directories.  I have all of the files I need, but I am not sure how to make sure that we get everything back the way it was, and the system mounts my drives:  I have a /1TB a /3TB an /8TB and a /320 (gig) external drives:  These get mounted in /media/brian/3TB, /media/brian/whole-bunch-of-numbers. and the others are mounted the same way. 

 

Then my fstab (file system table) DOES NOT have any of my drives OTHER then my /dev/sda, (root) /dev/sda1 (/boot), /dev/sda5 (as swap) and my optical drives (/dev/sr0 and /dev/sr1 in there, as /cdrom0 and /cdrom1 and I would need to use 'blkid' and 'fdisk -l' to list these drives to get the file info  I need to rebuild the fstable so it says what its is supposed to.

 

However, this thing with "UUID=kkfhjhfjhgjhe89gtug4kljhg" (whole bunch of long characters) is NOT helping me, because I am used to having the MOUNT POINTS in fstab, so that I can boot these on startup, and they mount like this:

/dev/sdb1       294G   13G  266G   5% /media/brian/THREE_20
/dev/sdd1       2.7T  593G  2.0T  23% /media/brian/3TB
/dev/sdc1       7.3T  2.3T  4.6T  34% /media/brian/8e50507f-bbc1-433a-a645-587a5ef2d767
/dev/sr1        644M  644M     0 100% /media/cdrom1
/dev/sde1       931G   13G  919G   2% /media/brian/MYTERRABOOK

Now, it is hard to determine what the drives ARE if you have "8e50507f-bbc1-433a-a645-587a5ef2d767" as a drive.  I can also give a copy of this things fstab, below

 
 /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/cardinal--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=846e9d9f-057b-46fc-ac72-16d21a3a35c3 /boot           ext2    defaults        0       2
/dev/mapper/cardinal--vg-swap_1 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sr1        /media/cdrom1   udf,iso9660 user,noauto     0       0

I need to clean this up, as the other drives (/sdb1, /sdc1, /sdd1, and /sde1 are NOT there, and I have 2 cdroms.

 

So, I also want to set the eth0 to ALWAYS show the address of 192.168.1.10, but each time I do this, it goes to .15 and will NOT lock there, and there is NO DNS anywhere, so last night, ping would not work right. 

 

So, HOW do I do a restore so that it puts back what I have, without wiping the system out?  seems that youtube does not give an example that I can follow!

 

Would LOVE a guiding hand here:  system is UP, but I need to restore MY files!

 

Brian


Edited by **Brian**, 14 June 2019 - 07:01 AM.

  • 0

Advertisements


#2
zep516

zep516

    Trusted Helper

  • Malware Removal
  • 8,107 posts

Hello,

 

Have you received any assistance with this?  It's certainly beyond my current skill set :)

 

Thanks

Joe :)


  • 0

#3
**Brian**

**Brian**

    Semper Paratus: Always Ready

  • Topic Starter
  • Member
  • PipPipPipPip
  • 1,164 posts

Good Afternoon Joe:

 

Thank you for responding:  I have had to reinstall SEVERAL times because of mistakes, but it seems that the only things I need to do for now is:

 

ONE: Set eth0 to the ip of 192.168.1.10, which will then resolve properly to buddy-baker.us (cardinal.buddy-baker.us), then add a couple DNS servers (1.1.1.1/8.8.8.8/8.8.4.4)

 

TWO:  make sure that I have all of my /var/www and /var information for proper install of fail2ban (Have to configure it),restore databases from my sites blogs, and then make sure that the data files are restored.

 

THREE:  Some of the files I have were .BZ2 files, even though I used a tar command, and some of them may be corrupted, but I am not sure how to use bzip to fix these files

 

will keep you advised :)

 

Thanks for the help :)

 

Brian


  • 0






Similar Topics


Also tagged with one or more of these keywords: #Debian 8, system restore, problems, help

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP