Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OSS community to the rescue!

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Fri May 26, 2006 12:13 am    Post subject: OSS community to the rescue! Reply with quote

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 Smile

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. Smile

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. Embarassed Embarassed

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 Sad 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 Smile

>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 Smile
> don't worry theoritically the cp is another process that have opened the file,
>so it won;t be deleted until it is done Wink
>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!! Smile

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.
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8455
Location: Warrington, UK

PostPosted: Fri May 26, 2006 9:01 am    Post subject: RE: OSS community to the rescue! Reply with quote

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)
Back to top
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Fri May 26, 2006 10:15 pm    Post subject: RE: OSS community to the rescue! Reply with quote

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 Smile ) and have read / owned several texts?

Cant keep running into #irc Smile
Back to top
View user's profile Send private message
towy71
Moderator


Joined: Wed Apr 06, 2005 3:11 pm
Posts: 4257
Location: wild West Wales

PostPosted: Sat May 27, 2006 12:38 am    Post subject: RE: OSS community to the rescue! Reply with quote

rute User's Tutorial and Exposition ought to keep you busy for a while Wink
_________________
still looking for that door into summer
Back to top
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Sat May 27, 2006 6:15 pm    Post subject: RE: OSS community to the rescue! Reply with quote

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! Smile
_________________
I think, therefore I compile
Back to top
View user's profile Send private message
tablewolf



Joined: Mon May 08, 2006 2:51 pm
Posts: 17

PostPosted: Sun May 28, 2006 7:08 pm    Post subject: RE: OSS community to the rescue! Reply with quote

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.
Back to top
View user's profile Send private message
jjmac
LXF regular


Joined: Fri Apr 08, 2005 2:32 am
Posts: 1996
Location: Sydney, Australia

PostPosted: Sat Jun 03, 2006 3:18 am    Post subject: RE: OSS community to the rescue! Reply with quote

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 Smile.

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 Very Happy


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 ...
Back to top
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Sat Jun 03, 2006 4:59 pm    Post subject: Re: RE: OSS community to the rescue! Reply with quote

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 Smile

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 Wink

Quote:

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.
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast