LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is there a "system restore" for Linux? What do you do when the system act badly? (https://www.linuxquestions.org/questions/linux-general-1/is-there-a-system-restore-for-linux-what-do-you-do-when-the-system-act-badly-704829/)

frog-o 02-15-2009 10:32 AM

Is there a "system restore" for Linux? What do you do when the system act badly?
 
In sort the title sum up what i'm ask for.

Is there a "system restore" for Linux?
What do you do when you system behaves badly?

I doing research on my idea bellow and before I dive into to much i figure i ask and make sure it has not already been done. I don't have much luck with google or other search engines and my searching skills are not the best i don't pick very good keywords words even with advance things like using - and + "" operators etc.

The problem

One thing i been good at is slowly goofing up my sabayon system(gentoo base system) without knowing what i done even after going though the logs which can be quit tier some. I often thought it would be nice if linux has a system restore so i can go back a few days and have it automatically fixed what every I goof up.

I often here my brother talk about use system restore on there window pc to do this type of thing.
I just can't believe Linux dose not have anything like this.

What tool are there for Restoring the Linux system when you goofed it up to badly you don't know what you did?

A probable weird solution

I notice I only use a small portion for my harddrive for my os itself i still have a lot free. About 14gb is being use for the os(which i think i could drastically reduce buy putting all my downloads in a different partition) and uninstalling the programs i don't want.

I have herd of installing linux in a directory(winlinux I believe dose this) and is what i would want to do. I would like to install linux in a directory (let just say for example we create a dir called syslinux in wich a linux system is installed) that when booted would mount a home partition (with all my download and other other big file that i don't want backup are in).

Then when i ready to backup my system i would unmount my home partition and copy my dir giveing it the date as the name(let for example just call in some like syslinux-2-15-09).
Then when i goof thing up to much i could just mv or delete as in the example above syslinux and copy back syslinux-2-15-09 to syslinux.

The reason i choose to to use a dir instead of a partition.
I know some people choose to partition there hardive a make a whole copy
of the partition but two my seem wasteful since you backing up blankspace and thing you don't need backup. Use a directory you eliminate this

Do you have a better ideas?

craigevil 02-15-2009 10:55 AM

No there is no System Restore, most issues in linux can be fixed without reinstalling.

ErV 02-15-2009 03:15 PM

Quote:

Originally Posted by frog-o (Post 3444312)
Is there a "system restore" for Linux?

No, there is system restore like in windows - i.e. no system that silently makes copies of files and wastes gigabytes of disk space just in case. And I don't see the need for that on linux.

However, you can manually backup whatever you want (including entire system) easily with "tar" command. There are probably other ways, but no windows system restore.

openSauce 02-15-2009 03:17 PM

Quote:

Originally Posted by frog-o (Post 3444312)
I know some people choose to partition there hardive a make a whole copy
of the partition but two my seem wasteful since you backing up blankspace and thing you don't need backup.

Not if you zero the blank space and compress the image. This is what I do, I trust it more than I would a system restore feature.

I don't know how you think "installing in a directory" is different from having separate system and home partitions, since you still plan to have a separate home partition anyway. In which case, backing up the whole system partition will take up less space than backing up files individually, since you'll be able to compress better (provided you zero the unused space first).

salasi 02-15-2009 03:20 PM

Quote:

Originally Posted by frog-o (Post 3444312)
One thing i been good at is slowly goofing up my sabayon system

Presumably, you do understand that not doing that would be you best way forward? OK, then...

Quote:

...without knowing what i done even after going though the logs which can be quit tier some. I often thought it would be nice if linux has a system restore so i can go back a few days and have it automatically fixed what every I goof up.
that's also not a good sign...the 'not knowing what you have done' part. what you seem to be talking about is snapshotting your system so that you can restore fron the snapshot.

Quote:

I notice I only use a small portion for my harddrive for my os itself i still have a lot free. About 14gb is being use for the os(which i think i could drastically reduce buy putting all my downloads in a different partition) and uninstalling the programs i don't want.
Yes, but...
firstly, lets dismiss your downloads; they really don't do anything for your OS, unless you mean patches/updates. Back them up somewhere and ignore that part of the problem and that probably takes care of the problem even if they are something to do with the OS, provided that you know how to use them.

Now there is the stuff under /home. back it up and ignore that part of the problem (you may want to put your downloads directory somewhere under /home in order to make that one problem rather than two).

So what you have left is your OS, your apps and stuff that you have altered. You should be able to get your OS back in the same way that you got it in the first place; you may be wanting to ensure that you cache stuff, so that you don't have to use a lot of time/bandwidth in getting it back. Same for apps and utilities.

Now the stuff that you have altered; there is stuff that you have altered on a per user basis. That will be stuff like configs for GUIs and they are stored in the user directories, so you already have those.

So then there is the stuff that you have altered. This is generally in text files in /etc. So back them up, and then you have everything.

Now there is a problem if originally had myapp_1.234 and you want to restore to a system that has myapp_2.000, but that was going to be a problem whatever you do.

Quote:

I know some people choose to partition there hardive a make a whole copy
of the partition but two my seem wasteful since you backing up blankspace and thing you don't need backup. Use a directory you eliminate this

Do you have a better ideas?
If you are going to copy something, it doesn't really matter whether its a whole partition or a collection of files if you can exactly specify them. So something if you are copying or tar-ing from a source to a target, the commands don't really care whether what you are copying is a complete partition, or not (well, provided that you have enough space to copy to).

(Oh, and there is one bit that I have missed; did you spot it?)

Drakeo 02-15-2009 03:27 PM

Quote:

No there is no System Restore, most issues in linux can be fixed without reinstalling.
And this is right. Sure it has been done many times over but the person that owns the system had to build it. The back up and clone programs been around a long time but yeap. Take a picture of your system and keep it around for the uneventful things.
It is up to you to make that image and keep it up to date.
Now we really have to take a look at what windows calls a restore it is an image of the system and there are some config files that keep some info. Thank the computer Gods for there isn't a system restore like windows. Windows will not fix or correct anything it creates another copy and your stuff is still got the broken stuff on it still.
this could be debated but leave that to Microsoft.
Mandrake 8.1 had a wonderful restore disk. saved me many times when I was learning linux and screwed things up. like xorg kernel drivers just the basic stuff. that was not a free OS at the time either.

openSauce 02-15-2009 03:37 PM

Quote:

Originally Posted by salasi (Post 3444581)
Quote:

Originally Posted by frog-o (Post 3444312)
One thing i been good at is slowly goofing up my sabayon system

Presumably, you do understand that not doing that would be you best way forward? OK, then...

To be fair, who doesn't mess up their system now and again? If you've not broken it, you've not been playing with it enough. Now if you know what you're doing, mistakes are usually fixable, but those of us who are still learning occasionally have to resort to a backup. Often it's quicker than working out what the problem is anyway.

frog-o 02-21-2009 07:23 AM

ErV wrote

Quote:

No, there is system restore like in windows - i.e. no system that silently makes copies of files and wastes gigabytes of disk space just in case. And I don't see the need for that on linux.
I think it really not fair to say you never have to restore Linux see below and why dose it have to be silent if you don't want it to be?

Linux is always said to be flexible.

I don't think anybody say's "hay let trash my system today !" :) ,Even thou some are reckless I don't consider me to be one of them.

salasi is write when he said

Quote:

what you seem to be talking about is snapshotting your system so that you can restore fron the snapshot.
Thanks salasi for putting it in simpler words :)

It would be nice to be able to boot from two different snapshot one to see what it was before i goofed it up and one after.


As far as the wasted space....

If it help solve problem I would hardly call it a wast and who say it has to be really big.

Is it not One of the most powerful feature of Linux is it ability to be be small and customize to your need?

Example of way to goof it up (some i did other I read not to do)

1.) Not running depmod -a,ldconfig after upgrade libary can some time goof thing up it can't find library it needs
I could not load my graphic drive because I did not run depmod -a. To this day i don't know why it was need all I know was it work after i done it.

2.)
If you not carefull with gcc you can break abi.

3.)Upgrade library break all library use old version.

In Gentoo this is fix with revdep-rebuild. At fist i did not know there was info on the comand line on the gentoo system I usually left when it was compile and doing it thing and done something else. For the longest time i was wounder why it was beeping.


4.) Having old alsa modules around.
upgrading programs which change the way the config files act.
I believe I had samba break once just buy upgrading samba because it change the defaults behavior on how privacy was handle in the config .


Yes these thing can be avoided if you know what you doing but that take time. Have a snapshot of what you did before and after can often help you find the cause of the problem a good reason for back ups and sytem restore feature.

5.) many more

Drakeo 02-22-2009 08:56 PM

Slackware 10.2 I really did some stupid thing letting a friend use my computer and they deleted some stuff and just goofed things up. Not sure but they must have assumed root some how. the cool thing about slackware is that I did a reinstall with out formating root.

It expanded the packages with a bunch of complaints some times but when I was done Slackware was running 95 percent. still had my pass words and from there I went to work on it. now that there is live cd

I just back up my home folder and reinstall.
another time I used Slackware to just extract some packages and run the install scripts and all was back to normal.

John VV 02-22-2009 11:02 PM

even when you do know what you are doing a typo or just " da- i was not thinking" when building a svn/cvs version of a program that NEEDS a newer version say - a newer gtk than gnome is using .
a goof with configure
example
gnome uses -gtk 2.4
gimp-svn needs gtk 2.8
correct one -building gtk 2.8
./configure --prefix=/opt/gimp_svn
WRONG ONE
./configure --prefix=/usr
make && make install
----------------
gnome is FUBAR

at this point it is still easer to reinstall the correct gtk
but sometimes a reinstall of fedora is the fastest and easiest thing to do

get used to doing reinstalls of the OS , at some point you will find that -- hay it has been a few years since i fubar'ed the computer . Then the next day YOU WILL .

ErV 02-23-2009 07:39 AM

Quote:

Originally Posted by frog-o (Post 3452189)
I think it really not fair to say you never have to restore Linux see below and why dose it have to be silent if you don't want it to be?

I think it really fair thing to say, because I never had to restore Linux system in windows way - even when I accidentally destroyed Master Boot Record. What I meant is that 99.9999999% problems on normal linux system can be solved without "system restore". If you are going to depend on automatic feature that is supposed to save you from mistakes, in the end that feature will screw up your system. If you really need backups - do them manually (incremental backups, etc) using various means available.

Quote:

Originally Posted by frog-o (Post 3452189)
Example of way to goof it up (some i did other I read not to do)

No offense, but those problems you listed doesn't look like something that would need system restore. On my system things like that can be fixed manually, so if your distribution has problems with that consider changing it to something else. System restore would be needed to problem that would need at least day to fix. Honestly, I can't imagine anything so devastating to happen on slackware. Most problems can be fixed from terminal or livecd very quickly, "broken" package that cause problems can be replaced from the same livecd (even if system doesn't boot, you screwed up everything, you can still fix it) with version that works or doesn't cause problems, so I simply don't see the need for "system restore". It is not Windows system where if something breaks, no one knows why, no one knows a way to fix it, and if you make reinstall, you'll lose all your settings.

nx5000 02-23-2009 10:00 AM

Ermmm..
http://www.mjmwired.net/kernel/Docum...r/snapshot.txt

SlowCoder 02-23-2009 11:44 AM

I don't trust System Restore in Windows. I've found that in the event of a major system meltdown or malware infestation, the System Restore is insufficient to bring the system back, or has even gotten infected itself, rendering it useless as a recovery tool.

Windows hides too much stuff to make it easy to restore functionality to your box. Unless it's a simple driver issue, I think it's easier to just reformat and reinstall.

GNU/Linux is different. Nothing is hidden, which makes it relatively easy to get back up and running.

John VV 02-23-2009 11:48 AM

Quote:

I don't trust System Restore in Windows.
in the past the few times i have used that it fubared my system even more . to the point that I DON'T USE IT ON XP . that service is OFF , it has never worked correctly .

frog-o 02-26-2009 04:35 PM

ErV wrote
Quote:

No offense, but those problems you listed doesn't look like something that would need system restore. On my system things like that can be fixed manually, so if your distribution has problems with that consider changing it to something else. System restore would be needed to problem that would need at least day to fix. Honestly, I can't imagine anything so devastating to happen on slackware. Most problems can be fixed from terminal or livecd very quickly, "broken" package that cause problems can be replaced from the same livecd (even if system doesn't boot, you screwed up everything, you can still fix it) with version that works or doesn't cause problems, so I simply don't see the need for "system restore". It is not Windows system where if something breaks, no one knows why, no one knows a way to fix it, and if you make reinstall, you'll lose all your settings.
Well yea they can be fix manually if you know how but if you system is goof up and don't have any experience with fixing it, How are you going to use it to solve your problem. Are you going to want to use a live cd just to surf the net to see what you goofed up?
Live cd always seem to boot up slowly and run stutterer-ly to me (maybe I did not git a good distribution). They seem to have way to many tools or not the one you want, the menu not organize the way you want it ether. I think have a snapshot you could boot of is a better idea. I think there are tool to help with some of the problem with live cd and make them fast and run more smooth but i think it would still be faster on the hard drive.

I Really don't like have tool automatic back up thing I would like to tell it to do so manually.

Buy reading your post above it sound like you good at fixing problem and i gussing you have lot of experience at it. Good for you. My problem is I'm still trying to learning. I always prefer to Have tool do thing for me like puching a button on the app and have it make a snapshot of my system that just work. If I feel up to I then dissect the tool to see how it work and if i can make it better.

I think that people with experience often take for granted there experience and forget those with out.

I think Having app make a snapshot of the system which you could boot off is to me a learn tool as well a a way to restore the system As I said earlier in my post It would be nice to boot of a couple of snapshot and come-pair the two snapshot of the system to see what exactly you goofed up.

In reply to other post I think windows system restore is goof up a bit I think Linux could do something a little bit better that that don't you ?

Make it easy to fix is a good start but not the whole salutation.
I think good documentation and and good backup-tools are also needed.

speck 02-26-2009 05:40 PM

This was pulled from the "most popular" list on Freshmeat.net. There are many programs that can image or backup your system (without you needing to write the code), here are a few.

G4L
BackupPC
Mondo Rescue
Make CD-ROM
Amanda

ggallozz 08-17-2012 10:07 AM

Quote:

Originally Posted by speck (Post 3458747)
This was pulled from the "most popular" list on Freshmeat.net. There are many programs that can image or backup your system (without you needing to write the code), here are a few.

G4L
BackupPC
Mondo Rescue
Make CD-ROM
Amanda

... and not forgetting CloneZilla ! ;-)

jefro 08-17-2012 04:12 PM

OpenSuse has a program to do something similar but a zfs or btrfs filesystem can do that to a point.

From the Opensuse web site.

"Snapper rolls back changes
openSUSE 12.1 is the first Linux distribution taking advantage of the snapshot functionality in the upcoming Linux file system btrfs. These snapshots of the file system are using copy-on-write, making them very space efficient. openSUSE 12.1 debuts Snapper which allows the user to interface with this technology.

The command line and GUI Snapper tools allow users to view older versions of files and revert changes. The unique integration in the zypper package manager of openSUSE allows users to roll back entire upgrades or software installations with the accompanying configuration changes. "

John VV 08-17-2012 08:37 PM

Hi ggallozz as jefro stated OpenSUSE dose have this option
BUT
Linux IS NOT Microsoft Windows
and DOSE NOT relay on the MS System Registry to HIDE information from the user

undoing something you just did is VERY simple
unless you royally messed something up
something like ??? say this...
!!! WARNING!!! DO NOT TRY !!!! WARNING !!! WARNING!!! DO NOT TRY !!!!!!! WARNING!!! DO NOT TRY !!!!!!! WARNING!!! DO NOT TRY !!!!
Code:

su -
yum -y remove glibc
------------
zypper -n rm glibc

something like that is unrecoverable


99.9999% of he time it is VERY easy to fix a "oops"

BillE 08-18-2012 01:31 AM

From one newbie to another newbie
 
No Linux does not have a system restore. I have not been bold enough yet to abandon (please don't be cruel) Windows. I really want to make sure that I have a good grasp on scripting (command line Linux), and other formidable Linux tools.
I personally would find a Linux variety that has more support and has been around longer (like one of the top ten mentioned in DistroWatch Debian, openSUSE, Slackware et cetera). If you intend to just try different things and you have anything worth keeping, put it on a different partition!
Other members have alluded but not really concretely wrote out what this could intail. On installation you can have your home directory on a different partition and / (which is short for the bootable system) on another. Or you could call up cdisk or fdisk and make a partition on the leftover space on your drive.
Then you could copy everything valuable there, or something closer to Windows use tar, or FileRoller.
But my best advise if you are a slow learner like me take your time and study the man(uals and info), and the documentation. They all are easier to find than the same information about Windows. But Linux Questions is also a resource. Hope this helps.
And I still give much respect to the Senior members.:study:

jschiwal 08-18-2012 02:40 AM

One thing I'd recommend is partitioning your hard drive so /home has it's own partition. That allows reinstalling while maintaining your personal documents.
Make a backup of your MBR. Also create an "fdisk -l listing and print it out. If the beginning of the drive gets wiped out, knowing where the /home partition starts will allow you to use losetup attach a loop device to it and mount it using a live distro.

sundialsvcs 08-21-2012 10:20 AM

You need to solve the problem. "System restores" don't do any real good even on Windows boxes.


All times are GMT -5. The time now is 11:28 AM.