• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::
            From: http://macguru.biz/macosxreapair.html

            Mac OS X Terminal repair routines

            Back to Main Page

            On any Mac OS X box, you can enter “single-user mode” by holding down command-S at startup. This gives you a root prompt and a read-only hard drive, from which you can commence your life of quiet desperation, er, troubleshooting.
            Normally, you would do this to repair the drive

            :# fsck -y

            This is exactly equivalent to booting off the install CD and repairing your disk using Disk Utility. In Mac OS X, Disk Utility is a graphical frontend on top of fsck. It works just as well in single-user mode because the drive is mounted read-only, so there’s no chance of files being modified while the repair is running.
            If fsck tells you that the file system was modified, reboot immediately

            :# reboot

            Repeat until fsck reports no errors. It is now safe to exit single-user mode and continue booting normally

            :# exit

            If you can not get to the login prompt, or your login window appears but shows no users and no username/password boxes, your NetInfo directory is probably corrupted. Reboot into single-user mode and trash it

            :# cd /var/db/netinfo
            # mv local.nidb local.nidb.corrupted
            # reboot

            Upon rebooting, Mac OS X will notice the missing NetInfo directory and will create a new blank one. This will not actually let you log in, however, since the new NetInfo directory contains no users. (Technically it contains a root user, but with login disabled.) Assuming you get to a login prompt, reboot once again into single-user mode and add a root password. This is trickier in 10.2 than it was in 10.1, but I believe this technique works in both (I’ve tested it personally in 10.2)

            :# SystemStarter

            Watch the status messages. When you see “Starting NetInfo”, hit CTRL+C to get back to a prompt, then type:


            # passwd root
            Password: (enter new password)
            Verify password: (re-enter new password)
            # reboot

            Here you are essentially hacking your way into your own computer by changing the root password. (And if root was previously disabled, this has the side-effect of enabling it.) Rebooting should get you to a login prompt where you can log in as root and get to work recreating your other users or recovering your data or whatnot.

            (It should be noted that the above method will also work on anyone else’s computer, but don’t do that. If this scares you, install Open Firmware Password Protection, which is essentially a BIOS password for Macs, and prevents booting into single-user mode without a password.)

            Another fun thing you can do is force your Mac to always boot into single-user mode, without holding down any keys at startup

            :# nvram boot-args="-s"
            # reboot

            Your computer should always boot into single-user mode from now on. To put it back to normal

            :# nvram boot-args=""

            Again, you can do this on anyone else’s Mac too, but don’t do that.

            Also check out this article at Apple's web site: Apple built -in repair utilities for OS X


            Even though Macs generally require much less maintenance than Window's machines, there are still a few easy things you can do to keep your Mac running in tip top shape.

            Repair Permissions

            Repairing permissions is one of the easiest and fastest maintenance tasks you can do on your Mac. You can start it easily at the click of a button, and let it run in the background while you continue to use your computer like normal.

            Each file on your Macintosh has a set of permissions, which say who and what can read or write to that file. When you install new programs, or when a file is corrupted, these settings can be changed and messed up. Generally they won't do anything major like crash your computer, but they can cause it to slow down over time.

            Luckily fixing the problem is very easy.

            To repair your permissions you need to start Disk Utility, which is in the Utilities folder in your Applications folder.

            Home > Applications > Utilities > Disk Utility

            After you open the application, click on the First Aid tab, then select the partition where Mac OSX is installed, in my case it is the "Macintosh HD". You don't need to select the entire hard drive, just the partition with your OS on it. Next click on Repair Permissions to start the process. You don't need to verify the permissions first.

            After you start the utility you'll see a bunch of text scroll by on the screen detailing what the application is doing, which files it's repairing, which ones are messed up, etc. After it's finished you can safely close the Disk Utility application.

            Periodic Maintenance

            My wife has the strange habit of cleaning and vacuuming the house at 1 or 2 in the morning sometimes. I don't understand this behavior, but at least she's not alone. Your Macintosh also cleans itself up at odd hours, namely between 2am and 5am each night. Mostly it's just deleting log files and cache's that it no longer needs, or backing up important files. But if your Mac is asleep or turned off, it won't be able to perform these tasks and those log and cache files will start to add up and waste space on your hard drive.

            So, to get rid of them manually we just need to type a few commands into the terminal which is also in the utilities folder.

            Home > Applications > Utilities > Terminal

            Type the first line below and then press return. It will ask you for your password, which should be the password that you use to login with. You may see a bunch of lines of code scroll by, which is normal. After you are returned to the command prompt again as you see in the screenshot, type the other two lines, pressing return after each, and allow them to run.

            sudo periodic daily
            sudo periodic weekly
            sudo period monthly

            Prebinding

            Forcing your Mac to update the prebinding will make it search through all of your application files and properly link them together, which can increase the overall speed of your computer, and how fast applications launch, etc.

            Open the terminal if you don't still have it open, type the following line in the terminal and then press return.
            sudo update_prebinding -root / -force

            You'll see a lot of text scroll by in the terminal, which is again completely normal. Immediately reboot after it finishes and you are returned to the command prompt.

            After you reboot you should notice a significant speed boost to your machine. Programs should start faster, you should be able to switch between them faster, etc.

            Perform these steps any time you notice your computer going slower, and repair permissions every time you install a new program, especially something like an OS update from Apple.

            Easy way out

            To take the easy way out, you could also run a maintenance app likeOnyx and MacJanitor to perform these tasks at the press of a button.

            posted on 2009-11-06 16:25 逛奔的蝸牛 閱讀(633) 評論(0)  編輯 收藏 引用 所屬分類: Mac
            久久免费观看视频| 久久精品亚洲男人的天堂 | 久久九色综合九色99伊人| 无码精品久久一区二区三区| 免费一级欧美大片久久网| 久久天天躁狠狠躁夜夜不卡| 久久精品蜜芽亚洲国产AV| 国产一区二区精品久久岳| 无码人妻久久一区二区三区免费| 久久免费小视频| 精品多毛少妇人妻AV免费久久| 久久精品国产福利国产秒| 伊人久久亚洲综合影院| 97久久精品人人做人人爽| 久久人妻AV中文字幕| 久久嫩草影院免费看夜色| 久久精品国产影库免费看| 亚洲人成网亚洲欧洲无码久久 | 欧美久久久久久| 国产精品毛片久久久久久久| 99久久国产综合精品女同图片| 91久久福利国产成人精品| 久久久久亚洲AV片无码下载蜜桃| 伊人久久五月天| 亚洲精品高清一二区久久| 四虎国产永久免费久久| 97久久天天综合色天天综合色hd| 国内精品伊人久久久久妇| 久久亚洲AV永久无码精品| 26uuu久久五月天| 日本精品久久久久中文字幕8| AV无码久久久久不卡蜜桃| 久久久精品人妻一区二区三区四| 久久人做人爽一区二区三区| 亚洲欧洲久久av| 久久夜色精品国产亚洲| 伊人久久五月天| 亚洲va久久久噜噜噜久久天堂| 久久无码中文字幕东京热| 久久亚洲AV成人无码软件 | 精品免费tv久久久久久久|