LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-21-2003, 09:09 AM   #1
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Rep: Reputation: 31
Did I just lose my mp3s with a bad mv command?


I just woke up, and was checking out some mp3s that got downloaded last night. There were some that had the filename format of ## song title.mp3 and others that had the filename format of ##-artist-song_title.mp3 (no spaces). So I wanted to move the ones with spaces to a separate directory. But I wasn't paying attention and issued the following command:
Code:
mv ./* *.mp3 albums/magnum_force
and I completely forgot to put an escape character to signify that I wanted an actual space between the asterisks. Now I can't find any of the mp3s that were in the directory, and a sub-directory is gone as well. Is there any way to recover these? Or are they gone for good?

The fs is ext3 (if that has any significance).
 
Old 04-21-2003, 09:47 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Have you tried performing a search for them first? Maybe with a find or locate command?
 
Old 04-21-2003, 10:55 AM   #3
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by trickykid

Have you tried performing a search for them first? Maybe with a find or locate command?

Yes sir. Actually one of the first things I did was run updatedb then locate mp3 |less My findings so far indicate that file recovery seems possible with ext2, but not ext3. The following is something I found at http://batleth.sapienti-sat.org/proj.../ext3-faq.html

Quote:
Q: How can I recover (undelete) deleted files from my ext3 partition?

Actually, you can't! This is what one of the developers, Andreas Dilger, said about it:

In order to ensure that ext3 can safely resume an unlink after a crash, it actually zeros out the block pointers in the inode, whereas ext2 just marks these blocks as unused in the block bitmaps and marks the inode as "deleted" and leaves the block pointers alone.

Your only hope is to "grep" for parts of your files that have been deleted and hope for the best.
 
Old 04-21-2003, 09:38 PM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I don't know what command you executed there, but it looks like it did some nastiness

You may want to add a line like:

alias mv mv -i

to your .bashrc or .profile or whatnot, to cause mv to prompt you for stuff like that in the future.

Boy, right here is a great answer for all those who ask "why not run as root all the time?"
 
Old 04-21-2003, 11:52 PM   #5
int0x80
Member
 
Registered: Sep 2002
Location: Cincinnati
Distribution: Debian GNU/Linux
Posts: 310

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by wapcaplet

I don't know what command you executed there, but it looks like it did some nastiness

You may want to add a line like:

alias mv mv -i

to your .bashrc or .profile or whatnot, to cause mv to prompt you for stuff like that in the future.

Boy, right here is a great answer for all those who ask "why not run as root all the time?"

Actually what happened was the mp3s and sub-directories that disappeared got moved to albums/magnum_force (luckily). Much thanks goes to realnowhereman over at DevShed. He put in a great effort to find out what really happened.

Also, I already went into .bashrc and made an alias for mv but included the --verbose option
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When command lines go bad bob7 Linux - General 3 09-11-2005 06:47 AM
Bad Command Prompt (??) ptreves Linux - Newbie 4 12-14-2004 09:40 PM
ifconfig bad command SDP Linux - Networking 5 03-18-2004 11:13 AM
bad graphics in command window poortl9109 Linux - General 7 01-08-2003 01:59 PM
rippers, mp3s and mp3s.... (?) bxb32001 Linux - General 0 07-14-2001 01:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration