Is it possible to delete prior copy of OS?

Posted:
in macOS edited January 2014
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

  • Reply 1 of 15
    davegeedavegee Posts: 2,765member
    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
  • Reply 2 of 15
    thuh freakthuh freak Posts: 2,664member
    Quote:

    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).
  • Reply 3 of 15
    bungebunge Posts: 7,329member
    Don't go to the command line.



    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.
  • Reply 4 of 15
    placeboplacebo Posts: 5,767member
    I don't see a real reason to use the Terminal instead of the Finder. Just log in as root.
  • Reply 5 of 15
    fahlmanfahlman Posts: 740member
    Quote:

    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.
  • Reply 6 of 15
    cubedudecubedude Posts: 1,556member
    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.
  • Reply 7 of 15
    placeboplacebo Posts: 5,767member
    Quote:

    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?
  • Reply 8 of 15
    thuh freakthuh freak Posts: 2,664member
    Quote:

    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.
  • Reply 9 of 15
    chuckerchucker Posts: 5,089member
    Quote:

    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 ).
  • Reply 10 of 15
    Quote:

    Originally posted by Placebo

    Just log in as root.



    *sigh*
  • Reply 11 of 15
    ast3r3xast3r3x Posts: 5,012member
    Quote:

    Originally posted by Brad

    *sigh*



    Brad says never use root.





    He now hates you for suggesting that.
  • Reply 12 of 15
    spartspart Posts: 2,060member
    I log in as root sometimes to mess with crap.



    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.
  • Reply 13 of 15
    baumanbauman Posts: 1,248member
    Now, I don't recall how the permissions on the previous system folder are set up, but, can't you change it from the get info dialog box?



    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.
  • Reply 14 of 15
    thuh freakthuh freak Posts: 2,664member
    Quote:

    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.
  • Reply 15 of 15
    baumanbauman Posts: 1,248member
    Quote:

    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?
Sign In or Register to comment.