Active Topics

 


Reply
Thread Tools
Posts: 12 | Thanked: 1 time | Joined on Jan 2010
#1
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?
 
Mike Fila's Avatar
Posts: 412 | Thanked: 480 times | Joined on Feb 2011 @ Bronx, NY
#2
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
 
eight's Avatar
Posts: 106 | Thanked: 81 times | Joined on Dec 2011 @ /
#3
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.

Last edited by eight; 2012-01-07 at 14:51.
 
Posts: 12 | Thanked: 1 time | Joined on Jan 2010
#4
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.
 
Posts: 856 | Thanked: 1,681 times | Joined on Apr 2010 @ Aleppo ,Syria
#5
looks like you did :
Code:
root
rm -rf ./*
if so then no big deal because by default there is nothing in /root expect the conf files/folders starts with ( . )

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)
 
Posts: 12 | Thanked: 1 time | Joined on Jan 2010
#6
@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?
 
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#7
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.

Last edited by michaaa62; 2012-01-07 at 18:58.
 
eight's Avatar
Posts: 106 | Thanked: 81 times | Joined on Dec 2011 @ /
#8
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?

Last edited by eight; 2012-01-07 at 23:46.
 

The Following User Says Thank You to eight For This Useful Post:
Posts: 346 | Thanked: 271 times | Joined on Jan 2010
#9
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 )
 
eight's Avatar
Posts: 106 | Thanked: 81 times | Joined on Dec 2011 @ /
#10
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
and post the output?
I think you deleted some hidden config folders under /root.

Code:
Nokia-N900:~# cd /root; ls -al
drwxr-xr-x   10 root     root          1096 Jan  8 01:00 .
drwxr-xr-x   26 root     root          1832 Jan  6 20:24 ..
-rw-------    1 root     root          1849 Jan  8 01:00 .ash_history
-rw-r--r--    1 root     root           412 Feb 19  2010 .bashrc
drwxr-xr-x    3 root     root           224 Jan  2 04:32 .cache
drwxr-xr-x    3 root     root           224 Jan  2 04:32 .config
drwxr-xr-x    2 root     root           520 Jan  6 20:36 .fapman
drwx------    2 root     root           160 Jul 14 08:54 .gnome2
drwxr-xr-x    2 root     root           240 Jan  6 20:26 .gstreamer-0.10
-rw-r--r--    1 root     root           274 May  5  2010 .gtkrc-2.0
-rw-r--r--    1 root     root           561 Dec 27 00:32 .htoprc
drwx------    2 root     root           376 Dec 22 17:16 .kismet
drwxr-xr-x    3 root     root           224 Jan  2 04:32 .local
-rw-r--r--    1 root     root           202 Feb 19  2010 .profile
drwx------    2 root     root           264 Jan  7 23:39 .pulse
-rw-------    1 root     root           256 Dec 18  2010 .pulse-cookie

Last edited by eight; 2012-01-08 at 00:31.
 

The Following User Says Thank You to eight For This Useful Post:
Reply

Tags
linux fail


 
Forum Jump


All times are GMT. The time now is 12:24.