Is it possible to delete prior copy of OS?
Due to a couple of minor issues, I just reinstalled OS 10.2.6. The system put the previously used OS (also 10.2.6) in a folder with all of its related stuff. It takes up about 2 GB. When trying to delete it (figuring I don't need it any longer) the system says I can't trash it due to something to do with a "root". Can this 2 GB worth of stuff be deleted or should it not be? Thanks!
Comments
sudo rm -r "/Previous System"
(or whatever the folder is called)
WARNING BE VERY CAREFUL WITH THIS COMMAND AS "rm -r" will do some MAJOR damage if used on the wrong directory (it'll delete EVERYTHING if your not careful)... Oh and remember the quotes since they help avoid doing some really bad stuff...
Dave
Originally posted by DaveGee
From the terminal:
sudo rm -r "/Previous System"
(or whatever the folder is called)
WARNING BE VERY CAREFUL WITH THIS COMMAND AS "rm -r" will do some MAJOR damage if used on the wrong directory (it'll delete EVERYTHING if your not careful)... Oh and remember the quotes since they help avoid doing some really bad stuff...
Dave
You need to be especially careful with the quotes used. If you do not include the quotes, that command may very well get rid of folders "Previous" (if it exists) and "System" (which is the current and very important system folder).
I think there's a folder inside Previous Systems that you can trash. The "Previous Systems" folder is just one level up and will hold all of the previous systems if you reinstall multiple times. You'll be left with an empty "Previous Systems" folder that isn't 2G if I'm correct.
Originally posted by Placebo
I don't see a real reason to use the Terminal instead of the Finder. Just log in as root.
He probably doesn't have root enabled.
How-To enable root:
1.) Open NetInfo Manager (Applications/Utilities/NetInfo Manager)
2.) In the Security Menu, choose Authenticate...
3.) Type in the Administrator's password, click OK
4.) In the Security Menu, choose Enable Root
5.) Enter a password for Root, click OK
6.) A dialog box will appear telling you that you need to Re-Athenticate, click OK
7.) In the Security Menu choose Authenticate...
8.) Enter the Administrator's password, click OK.
Originally posted by CubeDude
Though it most likely isn't neccessary, disconnect from the internet whenever you are in root. I know it probably doesn't make a difference, but it's just a precaution.
Why?
Originally posted by Placebo
I don't see a real reason to use the Terminal instead of the Finder. Just log in as root.
here's a few reasons:
(a) it requires you to logout of your current session, which means (in pre-panther macosx's) that you have to quit everything you are doing.
(b) it is very dangerous to be logged in as root, thats why it is disabled by default. any programs you run, or files you create, are owned by root, which means they have full power over the computer. if you incidentally do something terrible, like launch a virus (talking theory here, since there aren'y any mac virii yet), that virus would be able to `root` around your computer, delete files at will, start processes, and basically wreak havoc. it would be very difficult to stop it. if you launched a service, that wasn't a virus, and it stayed through when you log back into your normal user, you wouldn't be able to stop it, without becoming root again.
using sudo makes sure that your superuser (root) presence is as short as possible. its tougher to cause trouble as root, when you are only active for a short period. you should only be root for installing programs, or editing/removing system files. and such trivial tasks don't require logging in.
Originally posted by Placebo
Why?
Um, because everything you do as root has full permissions? So everything you execute will be executed with root access. Meaning that the potential for security issues is at its max (still lower than with Windows though :P ).
Originally posted by Placebo
Just log in as root.
*sigh*
Originally posted by Brad
*sigh*
Brad says never use root.
He now hates you for suggesting that.
I also have a script to make sure the Finder isn't running.
Do I recommend it anyway? No. Although I do think Apple should do something about the way logging in as root can screw up things. Normal users shouldn't be forced into the command line, ever. It just shouldn't happen.
Just click on the folder, get info, and change the owner to yourself. Then make all the contents do the same thing (there's a button to push).
All this sudo/root nonsense is way overkill. It's great that everyone wants to help, but try and make sure that what you say won't cause any more problems. For example, one terrible problem with logging in as root is that all the finder prefs that get changed are then stored with root permissions, and once you're back in your normal user mode, you won't be able to change them later.
Slightly off topic, but what happens when you delete a symbolic link? In the finder? Using rm in the terminal? For example, there are several symbolic links in the system that are hard coded. Does it delete the pointer or the file it's linked to? I would sure hope that it deletes the pointer... it could cause many, many problems otherwise.
Originally posted by bauman
Slightly off topic, but what happens when you delete a symbolic link? In the finder? Using rm in the terminal? For example, there are several symbolic links in the system that are hard coded. Does it delete the pointer or the file it's linked to? I would sure hope that it deletes the pointer... it could cause many, many problems otherwise.
in the finder, it almost definitely (i'm about 99% sure) that it just gets rid of the link (the "pointer"). in terminal, its a lot more hairy, and I got into trouble with this once (luckily i had a backup). if your link is to a file, then rm will get rid of the link. if your link is a folder, rm varies. this may not be true for all versions of rm, but atleast for the one that comes with macosx (i havent tried this with .0, but since .1 and later). if your symbolic link is named "mylink" for example and points to a folder, and you type:
rm mylink
your pointer/link is gone, not the underlying folder (this also works if mylink points to a file). if you try to remove the symlink thinking of it as a folder, and use the recursive option like this
rm -r mylink
you are safe. rm ignores the recursive option if you try to remove a regular file, and it does NOT dereference mylink without a trailing slash. but with this
rm -r mylink/
you are in trouble, cuz rm is now deleting (depth first i think) that folder. if you cancel it quickly (control-c), you might save the last folders. also, doing
rm mylink/
isn't dangerous, but bad. with the trailing slash, rm de-references the link (treats it as the destination place, not the pointer), and since it refers to a folder rm says it won't delete it (rm requires a recursive or directory flag to get rid of folders). so you're safe, but danger narrowly averted.
note: if the pointer points to a file, the trailing slash WILL dereference the link. so
rm myfilelink/
will get rid of the real file, and leave the now garbage link in place.
Lesson: be careful with rm, its dangerous. And make lots of backups.
Originally posted by thuh Freak
in the finder, it almost definitely (i'm about 99% sure) that it just gets rid of the link (the "pointer"). in terminal, its a lot more hairy, and I got into trouble with this once (luckily i had a backup). if your link is to a file, then rm will get rid of the link. if your link is a folder, rm varies. this may not be true for all versions of rm, but atleast for the one that comes with macosx (i havent tried this with .0, but since .1 and later). if your symbolic link is named "mylink" for example and points to a folder, and you type:
rm mylink
your pointer/link is gone, not the underlying folder (this also works if mylink points to a file). if you try to remove the symlink thinking of it as a folder, and use the recursive option like this
rm -r mylink
you are safe. rm ignores the recursive option if you try to remove a regular file, and it does NOT dereference mylink without a trailing slash. but with this
rm -r mylink/
you are in trouble, cuz rm is now deleting (depth first i think) that folder. if you cancel it quickly (control-c), you might save the last folders. also, doing
rm mylink/
isn't dangerous, but bad. with the trailing slash, rm de-references the link (treats it as the destination place, not the pointer), and since it refers to a folder rm says it won't delete it (rm requires a recursive or directory flag to get rid of folders). so you're safe, but danger narrowly averted.
note: if the pointer points to a file, the trailing slash WILL dereference the link. so
rm myfilelink/
will get rid of the real file, and leave the now garbage link in place.
Lesson: be careful with rm, its dangerous. And make lots of backups.
Wow. Good information. Thanks bunches.
So, it would be a bad idea to type 'sudo rm /Volumes/ExtHD/mach' (mach is a pointer to /mach.sym --note that it's hard coded!) on my external hard drive when I'm running my internal as the boot drive. Yikes... is there a 'rmlink' command (or something like it) for removing symbolic links? Or is this just one case where I should use the finder?