It's not "Broken Device", you cannot break N9 just by deleting files. Windows does not recognize it because you are missing drivers. As for Ubuntu, it should recognize it immediately, as drivers are built-in. Are you running Ubuntu on virtual machine or baremetal? If you use VM, then you need to make sure that USB is routed correctly from host to guest. (set up guest addons or something on virtualbox, I think...)