Click to See Complete Forum and Search --> : My escape from ultimate dispair!


roamingnomad
04-07-2004, 11:48 PM
While compiling my new kernel, I accidentally deleted my .config file (can't remember how now, but I remember going "wait a second..." *ls .config* "crap it's not there!").

Then I said.... 'hey, Linux doesn't usually write changes to the hard disk until shutdown, right?'

So I took the chance and hit the reset button. And (thankfully) .config is there now! w00000t!

leonpmu
04-07-2004, 11:59 PM
You musth've been using ext2 right?? 'Cause ext3 goes WAMMO, bye,bye data, when you hit delete!!!!

But cool stuff dude, that is why you should cp your .config to somewhere safe, maybe /home/[user]/backup....
:D

knute
04-08-2004, 12:12 AM
[devil mode]
Just make sure that you don't follow that command with the little gem called rm -Rf /home/user/backup... :D

Or you could aways back it up to /dev/null. That's such a nifty little place to store things! ;)

Though, I hear that it's hard to find anything there. Hrmmm.. wierd... :confused:

hehehe....
[/devil mode]

sandboy6184
04-08-2004, 12:32 AM
can someone elaborate on this"

"Then I said.... 'hey, Linux doesn't usually write changes to the hard disk until shutdown, right?' "

gehidore
04-08-2004, 01:14 AM
dont ever try that with ReiserFS and mp3s ooohh thats a bad one

knute
04-08-2004, 01:55 AM
Originally posted by sandboy6184
can someone elaborate on this"

"Then I said.... 'hey, Linux doesn't usually write changes to the hard disk until shutdown, right?' "

It's called syncing. What happens is that changes stay in memory for -- I don't know how long -- apparently not past shutdown, or when the sync command is issued, then stuff get's written.
Reiser and ext3 are journaled filesystems, which mean that they sync the disk to the memory at anywhere from 5 to 15 second intervals (if there are changes, that is). That means that should the power cut out, or the system go down unexpectedly, you lose less work.

It also means that your fubar's take effect in like NOW. :D

HTH

JThundley
04-08-2004, 02:35 AM
dude, you can get back your .config easily:

zcat /proc/config.gz > .config

If there is config.gz that is :)

Loki3
04-08-2004, 03:17 AM
You just inspired me to back my .config up to my /boot partition. Lucky break for both of us, eh?

mdwatts
04-08-2004, 09:46 AM
Originally posted by roamingnomad
*ls .config* "crap it's not there!".


ls .config

OR

ls -al .config

??

The first would not display a hidden file.

mrBen
04-08-2004, 09:59 AM
Originally posted by mdwatts
ls .config

OR

ls -al .config

??

The first would not display a hidden file.

Not true:


mrben@hobbes:~$ ls .mu*
.mutt-aliases .muttrc


ls on it's own will only output non-hidden files, but if you provide it with a glob that begins with a . it will output the hidden files.
You must have the . though - a * or ? will not match it:


mrben@hobbes:~$ ls ?mu*
ls: ?mu*: No such file or directory
mrben@hobbes:~$ ls *mu*
ls: *mu*: No such file or directory

Icarus
04-08-2004, 12:10 PM
I've been backing my config up to /boot with my kernels. I'm a lamer and use genkernel in Gentoo and it has an occationall wacky habit of axing the .config randomly (well, by default it does if you don't use the --oldconfig option ;))

If you make new kernels often it's a good practice to take the last good working config and give it a name like config-2.6.4 or something so you know what it was for

mdwatts
04-08-2004, 12:38 PM
Originally posted by mrBen
Not true:


You are correct. If you specify the hidden filename, using 'ls' without any options will of course display the filename.

I'm not very bright today as I thought I was in my home directory when testing with

ls .bash_history

and just found out I was in /. :rolleyes:

roamingnomad
04-08-2004, 10:54 PM
oh...... just found out I lost my Mozilla Thunderbird config.

Oh well... what's five minutes to a few hours?

And also, backing up on /boot sounds REALLY good.

Alex Cavnar, aka alc6379
04-08-2004, 11:44 PM
Originally posted by knute
[devil mode]
Just make sure that you don't follow that command with the little gem called rm -Rf /home/user/backup... :D

Or you could aways back it up to /dev/null. That's such a nifty little place to store things! ;)

Though, I hear that it's hard to find anything there. Hrmmm.. wierd... :confused:

hehehe....
[/devil mode]

True story, from one of my UNIX instructors:

She was on a job site where they had a newb of a sysadmin. Some UNIX admin publication had published an April Fool's edition. Included in the issue were tips to "Speed up the performance" on your UNIX system. They were, of course, jokes in the spirit of April Fool's day.

One of the "tips" was for speeding up system backups. Instead of having tar write to the magnetic tape device (/dev/mt0 on Linux, I think), have tar write the backup file to /dev/null. This newb sysadmin actually took this tip to heart and had been using it for an entire year's worth of backups! Of course, one thing led to another, and they had a disk go bad or some other type of hardware failure. When it came time to restore the backed up files, imagine the sysadmin's shock when the tapes contained NOTHING! ABSOLUTELY NOTHING! He had lost an entire year's worth of data.

Then, imagine the sysadmin's shock as he found himself suddenly unemployed! :rolleyes: