![]() |
stupid mistake while ex rm -rf
I made a stupid mistake, I wanted to clear everything from my sdcard but I forgot to actually go to the card. so I opened terminal, logged in as root, mounted the drive and gave the commando rm -rf ./*
Everything seems to work but when looking in the filemanager app I only see nokia N900 and sdcard. Do I need to flash my device to correct my mistake or is there an alternative? |
Re: stupid mistake while ex rm -rf
so the prompt was nokia-n900:~#? sounds like you deleted everything, if you go back into terminal as root and do ls -R is anything listed?
btw the easy way to delete an sd card is from file manager long press and choose format |
Re: stupid mistake while ex rm -rf
Assuming you were in /home/usr the command "rm -rf ./*" should have erased all files and folders inside /home/user including MyDocs, an equivalent command is "rm -rf *", it does the same.
The "." (dot) stands for the actual folder, you can list it with "pwd" (Print Working Directory) and "*" means all, "-r" is recursive. edit: If so you deleted basically the MyDocs Folder and some log files. The root partition and /home/opt (space for programs) should be ok. However better than without the dot. Maybe you can restore some files with photorec, I never used it, only tesdisk in the past which is recommendable when dealing with partiton errors. |
Re: stupid mistake while ex rm -rf
thanx for the reply's.
@mike fila: I assumed that I was indeed in Nokia-N900:~# when I do an ls there is nothing but when I do an ls -R as you suggest I get loads of screen output (I assume dirs). @eight I still have stuff under the /home/user dir (including MyDocs). and also under /home/opt. when I do a pwd when logged in as root I see /root and a ls gives me nothing. |
Re: stupid mistake while ex rm -rf
looks like you did :
Code:
root but if you did sudo gainroot instead then it would be a bigger problem but you said you have your MyDocs so it's fine in short : you were luck you wasn't in place else than empty /root/ you don't need a reflash how ever it's recommended to check your backup grabbed from backupmenu (if you have one) and restore (if any missing files from N900 are in it) |
Re: stupid mistake while ex rm -rf
@karam,
Yes that is what I did. So no big issues then. I only made a backup with nokia pc suite (windows) can I use that as a reference? |
Re: stupid mistake while ex rm -rf
Nope, there is no file from /root saved to the backup, may that be via suite or via the in-built Backup Application, only user stuff like settings, bookmarks, contacts, conversations and application list are stored in a backup container. It is not necessary to restore anything under root, until you remember having tweaked a certain file manually. Those files, the application need for storing config data, will get build on the fly.
|
Re: stupid mistake while ex rm -rf
Nokia PC-Suite will only backup contacts, calendar and other PIM data. It will not help if you delete or change system files. For a systembackup of all files you will need backupmenu which saves and restores whole partitions to image files.
If you don't know backupmenu you should better not use such risky commands in the terminal unless you know exactly what it does. As said, if you forgot to type the dot, or if your working directory had been /, not one file would be left. Where did you get that tip? |
Re: stupid mistake while ex rm -rf
If you were in /root/ and did rm -rf ./* then you deleted absolutely nothing since * doesn't expand to files/dir that start with . ( I assume that /root/ doesn't contains anything except config files/dir starting with a dot which should normally be the case )
|
Re: stupid mistake while ex rm -rf
In this case it expands to dirs/files that start with dot.
* means all including files/folders beginning with a dot (marked hidden). @ Day_Dreamer Could you run Code:
cd /root; ls -al I think you deleted some hidden config folders under /root. Code:
Nokia-N900:~# cd /root; ls -al |
All times are GMT. The time now is 19:35. |
vBulletin® Version 3.8.8