Well first of all you shouldn't probably turn off your compuer, nor write anything onto the partition where the deleted data is. It depends on a few things, but if you happen to overwrite on the areas where the "deleted" files are, they're unrecoverable after that.
The easiest start probably is to use the (graphical, most of the time) recovery programs available on the net; some of them are free of charge, some not, and most of those that are "free to try" don't actually recover anything unless you buy the full product, but at least they should show you if they can find the "deleted" files. With luck you might find a program that can bring them back, but I wouldn't count on it..the primary way to prevent data loss is making backups of your important data, and if you don't happen to have backups, it usually means either you don't consider your data important or then you're just pushing your luck for fun
Making an image of the partition shouldn't be difficult, but it's going to be as big as the partition is (free space doesn't matter; it's imaged as well), so make sure you've got enough space. With dd, for example, the command would be
Code:
dd if=/dev/sda2 /media/storage/image_file
which would make an image from your primary (a) harddisks's (sd on newer distributions; on older ones IDE disks are hd, not sd) second partition (2) and store it to /media/storage/ directory under the name "image_file". To make the partition naming more clear, here's how it goes: on old systems IDE disks are hda, hdb and so on, and scsi things sda, sdb and so on. On newer distributions all harddisks should be just sda, sdb, ... (so the 'hd' naming for IDE disks would be dropped off). See which ones you got. The letter tells if the drive is primary (sd
a) or secondary (sd
b) and so on, and the number at the end which partition it is, counting from 1 (first partition) on - third partition of primary disk would be sda3 while first partition of secondary disk would be sdb1. So once you've figured out your partition device file name, just dd it if you want. It takes time if the partition is big.
If you've got the original media where you got the music from, then you have an easy solution: just automate re-ripping the discs, and you're done in a few days or so, or less depending on how intensively you do it. A simple script handles it in one command, and all you got to do is change discs and re-run the script (whicn in turn runs the ripping and encoding programs). And if you don't have the original media (read: you downloaded the music illegally), then you don't need to get the files back, because that wouldn't be legal. Or if you downloaded them from a web store, either they have some sort of "warranty" for cases like this and you can re-download, or then it's stated in the rules that it's your loss if you didn't backup.
I'd say that if the various file recovery programs on the net (a web search gives you a zillion of them, try those that are highest rated - they are for Linux too) don't do the job, your next best option is to just re-rip the original media. You could take the disk to a commercial recovery firm and they would probably do the thing, but it's got two drawbacks: if the content is illegal, you wouldn't maybe want to show it to them, and on the other hand it costs a lot of money. Well, if the data is
important then money is no problem (if it was, you had backups because it's cheaper, right?).
So - bring the original media in and start ripping and encoding if you necessarily want the audio to be on your harddisk, next time remember to make backups once in a while to prevent this sort of stuff from happening, and learn from this (and in case the music was pirated, I'm not even sorry for you losing it).