Oct
31
By
Rico at 12:33 pm ·
分类:
Linux,
OS X
由于PC上的休眠bug,死机后用fsck检测硬盘,出现奇怪提示:
jiang-ricos-computer:~ jiangrico$ mount
/dev/disk1s1 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
/dev/disk0s1 on /Volumes/data (local, journaled)
automount -nsl [125] on /Network (automounted)
automount -fstab [134] on /automount/Servers (automounted)
automount -static [134] on /automount/static (automounted)
jiang-ricos-computer:~ jiangrico$ fsck -y /dev/disk0s1
Can’t open /dev/rdisk0s1: Permission denied
jiang-ricos-computer:~ jiangrico$ sudo -s
Password:
jiang-ricos-computer:~ root# fsck -y /dev/disk0s1
** /dev/rdisk0s1
BAD SUPER BLOCK: MAGIC NUMBER WRONG
LOOK FOR ALTERNATE SUPERBLOCKS? yes
SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).
试着用fsck -b时又出现错误提示: 更多 »
无留言
Oct
31
By
Rico at 10:22 am ·
分类:
OS X
从Windows上远程连苹果非常简单。
设置苹果系统
在System Preferences中选择Sharing:

在打开的Sharing配置里勾中Apple Remote Desktop,将弹出一个配置对话框,该对话框点Access Privileges…按钮也出现: 更多 »
无留言
Oct
30
By
Rico at 3:58 pm ·
分类:
OS X
To “refresh” the sudo timer, type sudo -v <RETURN>. This will reset the timer back to zero, giving you another full five minutes to use sudo before you need to re-authenticate. On the other hand, if you’re the paranoid type and you want the sudo timer to expire immediately, type sudo -k <RETURN>.
If you know you’re going to be using a lot of commands that might need root access, you can tell Terminal to maintain your temporary root access until you exit the session. To do this, type sudo –s <RETURN>. You’ll be asked for your password (enter your personal account password). Once you’ve authenticated, you’ll have root access until you end your session (by typing exit <RETURN>, or by closing the current Terminal window). You’ll notice that after issuing the sudo –s command, instead of your normal Terminal prompt, which includes your username, the Terminal prompt will say root#
无留言
Oct
30
By
Rico at 10:39 am ·
分类:
OS X
- In Terminal, follow steps 1 through 4 in the previous exercise (starting up in single-user mode, using the fsckmount commands, and renaming the “bad” database via the cd and mv commands).
- Use the nicl (NetInfo command line utility) command to create a new NetInfo database:
nicl -raw local.nidb –create <RETURN>
- Use the niload command (which loads data into your NetInfo database) to move data from the backup created by the daily script into the new database:
niload -d -r / -t localhost/local < /var/backups/local.nidump <RETURN>
- Restart your computer by typing reboot <RETURN>. This command tells the computer to finish any disk writes that are in progress and then restarts the machine.
When you reboot, OS X will use the newly restored NetInfo database.
无留言
Oct
30
By
Rico at 10:36 am ·
分类:
OS X
Single-user mode is a limited way of working directly with the file system of your Mac OS X computer without actually logging in as a user. What you see in single-user mode looks a lot like what you’d see in a Terminal window— text on a black screen. The benefit of single-user mode is that in most cases you can use it even if you can’t boot up or log into OS X. (Even if you can log in, you should still use single-user mode to restore your NetInfo database, since the current database is in use when you’re logged in and can’t be replaced). Here are the steps to take:
Reboot or start up your Mac; immediately press and hold command+S. You’ll see a bunch of text scroll by, until you see the following:
Singleuser boot — fsck not done
Root device is mounted read-only
If you want to make modifications to files,
run ‘/sbin/fsck -y’ first and then ‘/sbin/mount -uw /’
localhost#
(The last line may instead be localhost:/ root#)
If you’re having problems, the first thing you should always do when booting into single-user mode is run fsck, OS X’s built-in disk utility, to make sure your drive is healthy. Type the following at the prompt:
/sbin/fsck –y <RETURN>
If you get an error that the file system was modified, run the command again; keep running it until you get a message that everything is OK. Note that if you get a message that the “Volume is journaled,” you should instead use the command /sbin/fsck –yf <RETURN>.
Doing other maintaining.
Restart your computer by typing reboot <RETURN>. This command tells the computer to finish any disk writes that are in progress and then restarts the machine.
When you reboot, OS X will use the newly restored NetInfo database.
无留言