OSS community to the rescue!

Discussion topics, Linux related - not requests for help

Moderators: ChrisThornett, LXF moderators

OSS community to the rescue!

Postby nordle » Thu May 25, 2006 11:13 pm

I had to post this, as I've just been saved from my own INCREDIBLE level of stupidity. Discussion is maybe the wrong place, as you may not have been as stupid as me or would not want to own up to it :)

A mate had recorded another mates wedding and asked if I could bung it on DVD, to which I said no problem. So I've transferred the file over and deleted the data from the SD.... why, becuase I thought it was a copy and I stupidly thought "he could use the free space and Im about to master a DVD anyway".

First mistake

So I did a couple of 5min test runs of encoding to get a decent fit, size, cropping etc and was happy with the result. So I started the encode for real, and then bumbled into konqueror to delete the test runs.
You know it was going to go wrong from here. :)

So I highlight the two files, now in konq if you press delete, it simply moves them to the trash, very easy to recover, but knowing that they were junk I selected to use shift+delete. ie do not past the trash bin, do not collect £200, straight to hell for those files.
Then, of course, I realised I'd just deleted the source file and the partially created final output. :oops: :oops:

So Im checking the trash, hitting F5 like a nutter in the hopes the files re-appear. I check the cli, and bizzarly (for someone who knows little about linux) the encode is still running, its got 80mins to go.

So do I have 80mins, or is this a cruel trick whereby it runs and runs.

==========================================
I dash into #mplayer and beg for help, straight away suggestions come in
>debugfs could probably do it if you're on ext2/ext3
yay, its ext2 (for large video files). I check man debugfs. yay quickly turns to aggghh, possible corruption, inode, suerblock, holy crap I could lose gigs of data (stuff not backup up in last week).

> suspend mencoder (ctrl+z)
>they're not deleted until the last process which open() close()s them
Are you SURE, I've got 80mins left for this to encode. If I kill ctr-z, wont the kde delete then immedietly kick in and I've lost the file?
>in unix you can remove a file that is open. it looses all links and will be deleted when it is closed.

so its safe to ctrl+z now or should I read man dubugfs first, I've got 80mins to solve this....i hope :( what an idiot!
> nordle: you have 79.99 minutes to find out before pressing ctrl+z

I can hear the mission impossible theme tune in the background :)

>i'm going in /proc/${PID}/fd
>ls -la will give you file discriptor number, path to the file and "(deleted)" string
>coping the descriptor copies the file

Its 1.5GB, this may take time
weird, the /tmp/newfile is growing.....slowly, will the encode finish before the copy.....maybe I should change the performance governer and turn the cpu down to 1ghz, slow the encode :)
> don't worry theoritically the cp is another process that have opened the file,
>so it won;t be deleted until it is done ;)
>you can use renice (e.g. `top` and then "R" on mencoder)

==================================

It worked!
Managed to copy the file out to another location from within /proc while it was encoding, and with 56mins left on the clock, way better than Tom Cruise!! :)

They totally saved me from my own stupidity. Im blaming sleep deprevation over the last couple of weeks!
Sure enough, when the encode has finished and it _let go_ of the files, both the source and the fresh encode were immediately deleted.
Konqueror tried to save me by defaulting to the trash can, but I ignored, I could have run the rsync backup but I've been turning the server off now to save a little on the electrivity, it was on 24/7 but only used 3/5 I need not delete the original until after creating the master.

All these things, normally I'd get away with, but it only takes 1 to go wrong.

Big thanks to iive from #mplayer, saved my bacon!

Now, wheres my copy of linux in a nutshell must actually read some of it on filesystems.
User avatar
nordle
LXF regular
 
Posts: 1500
Joined: Fri Apr 08, 2005 9:56 pm

RE: OSS community to the rescue!

Postby nelz » Fri May 26, 2006 8:01 am

Good save! and useful info.

Just to clear up one point, Ctrl-Z doesn't kill the process, it only suspends it, so its open files should stay open. It didn't matter because you had an 80 minute deadline, but with a smaller file you'd have had a more Mission impossible like deadline, so Ctrl-Z gives you time to find this thread and save the file.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

RE: OSS community to the rescue!

Postby nordle » Fri May 26, 2006 9:15 pm

I'm a windows guy by trade, which isn't surprising, the *nix land keeps amazing me. Its a _real_ systems system, it allows you to really do stuff with it and maintain a system.
To do what I did in windows would require some sort of software which I guess reads blocks marked as being able to be overwritten and re-read whats on them.

I was concerened about the ctr+z that it would allow the delete command to kick in, but as you say its suspend, and thats what they told me on irc, but I said "are you sure" which is a little insulting but I wanted to make sure wires weren't being crossed.

Is there a good, large, linux admin book? I've got nutshell, which is good, but its not too hot on quality workarounds like the one above, its more just a reference of man pages (a very good one, a must have!)
Maybe something in the cookbook series / style. Im only asking because you must deal with this stuff a lot (administering systems, not deleting files by mistake :) ) and have read / owned several texts?

Cant keep running into #irc :)
User avatar
nordle
LXF regular
 
Posts: 1500
Joined: Fri Apr 08, 2005 9:56 pm

RE: OSS community to the rescue!

Postby towy71 » Fri May 26, 2006 11:38 pm

rute User's Tutorial and Exposition ought to keep you busy for a while ;-)
still looking for that door into summer
User avatar
towy71
Moderator
 
Posts: 4266
Joined: Wed Apr 06, 2005 2:11 pm
Location: wild West Wales

RE: OSS community to the rescue!

Postby nordle » Sat May 27, 2006 5:15 pm

Thanks tow71, I'd forgotten about rute, used it once when setting up exim a few years back and not looked since. Maybe I should! :)
I think, therefore I compile
User avatar
nordle
LXF regular
 
Posts: 1500
Joined: Fri Apr 08, 2005 9:56 pm

RE: OSS community to the rescue!

Postby tablewolf » Sun May 28, 2006 6:08 pm

That must have scared the living daylights out of you, nordle. Did you ever tell you friend what had happened, or did you just play it smooth and pretend that everything went fine? If I were in your situation, I would have kept shtum. The risk of diminishing trust would have been too great.
tablewolf
 
Posts: 17
Joined: Mon May 08, 2006 1:51 pm

RE: OSS community to the rescue!

Postby jjmac » Sat Jun 03, 2006 2:18 am

Hey,

Good on you for the informative post. And no, your not the only one capable of deleting things they shouldn't. I recently wiped out 7 Gibs of my main drive (grin), which was kinda, well, i should have taken more care. It happens ... Luckily back ups were able to recover things almost completely. And now i've got a really nice LVM corps to autopsy on .. So it's turned into a kind of forensic positive.

Would fonts or eye issues have been involved there ?. Personally, i go a bit myopic at times.

I guess the ctr-z suspend was to allow for time. It's nice to see posts like that, it shares the 'tips & tricks' practicalities.

>>
... or would not want to own up to it Smile
>>

I think people tend to just keep their traps shut :).

It's one of the really good things about Linux ... it does allow for the 'mistakes' process to occur in a relatively safe setting. Someone training as an operator or in some other site related thing, they can hardly get a chance to touch a console. Mistakes can cost money there.

Maybe other people will post some of their bloops, the ones that were wiggled out of that is ... just to spread the info. No anominous posts allowed :D


jm

Humpty Dumpty Was Pushed !
Must Have Sat To High On The Wall ?
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
jjmac
LXF regular
 
Posts: 1996
Joined: Fri Apr 08, 2005 1:32 am
Location: Sydney, Australia

Re: RE: OSS community to the rescue!

Postby nordle » Sat Jun 03, 2006 3:59 pm

tablewolf wrote:That must have scared the living daylights out of you, nordle. Did you ever tell you friend what had happened, or did you just play it smooth and pretend that everything went fine? If I were in your situation, I would have kept shtum. The risk of diminishing trust would have been too great.


It was a bit of a concentrating moment thats for sure! I did fess up afterwards, but to be honest, if the situation had not been resolved I probably would have lied through my teeth about how the dog ate it or something.

I have morals, but they are known to bend now and then :)

jjamc wrote:no, your not the only one capable of deleting things they shouldn't. I recently wiped out 7 Gibs of my main drive (grin), which was kinda, well, i should have taken more care


Ahh, that makes me feel a lot better, its always good to see someone elses miss-fortune ;)

Would fonts or eye issues have been involved there ?. Personally, i go a bit myopic at times.


I do tend to do this stuff late, 12-1am, so I think I just was in a rush, tyred and not paying attention.
User avatar
nordle
LXF regular
 
Posts: 1500
Joined: Fri Apr 08, 2005 9:56 pm


Return to Discussion

Who is online

Users browsing this forum: No registered users and 0 guests