[R] R CMD build wiped my computer
Marc Schwartz
marc_schwartz at me.com
Wed Jul 28 00:31:47 CEST 2010
On Jul 27, 2010, at 4:53 PM, Duncan Murdoch wrote:
> On 27/07/2010 4:39 PM, Jarrod Hadfield wrote:
>> Hi,
>> I ran R (version 2.9.0) CMD build under root in Fedora (9). When it
>> tried to remove "junk files" it removed EVERYTHING in my local
>> account! (See below).
>> Can anyone tell me what happened, and even more importantly if I can I
>> restore what was lost.
>
> You did several things you shouldn't have done. Don't run as root unless you need to do what root can do. R CMD build shouldn't need special permissions, so it shouldn't be run as root. (Actually, it looks as though you didn't run as root: you got a number of "permissions denied" messages.)
>
> And don't run obsolete versions of R. There have been a lot of bug fixes since 2.9.0; you should take advantage of them.
>
> You should have known those two. One thing you might not have known is that it's a bad idea to name a package with the version number in the directory name. I don't think this will cause a lot of trouble with current versions of R, but it won't work. Apparently in 2.9.0 it caused a lot of trouble.
>
> Basically you need to restore from your backup. If you don't have one, you just learned how important Davidson's laws of computing are:
>
> The First Law: Back it up.
>
> The Second Law: Do it now.
>
> It may not sound like it, but I am sympathetic.
>
> Duncan Murdoch
I also noted the "$" in your prompt:
[jarrod at localhost AManal]$
rather than a "#", which would have indicated that you were running the command as root. No sign of the use of 'sudo' in the command either. So the good news is that the damage should be limited in scope.
It was not clear to me why the removal of files should have occurred as part of the process, however Duncan's reply offers an explanation.
I might just augment his comments regarding obsolete versions with my own, pointing out that Fedora 9 went End of Life a year ago. This means that you have not had any patches, bug fixes and security updates to your operating system and Fedora repo based applications for a year, which is also bad. Currently, the only supported versions of Fedora are 12 and 13. So you really need to think about a major upgrade of your Fedora installation.
If you have to consider restoring your local user tree from a backup, or worse, if you unfortunately don't have one, this would be a good time to upgrade your Fedora distribution. If you don't have a routine backup process in place, something like 'rsnapshot' might be worthy to consider. It provides an rsync based incremental backup system, much like Time Machine on OSX, albeit without the fancy GUI. It is what I used on Fedora until I moved to OSX last year.
Regards,
Marc Schwartz
More information about the R-help
mailing list