» 您尚未登录:请 登录 | 注册 | 标签 | 帮助 | 小黑屋 |


发新话题
打印

[心得] 双硬盘/分区 移动OSX /Users 目录到其他磁盘或分区的方法

Blog 原文链接
已经被墙
http://beterhans.blogspot.com/2014/03/move-or-mount-users-to-another-disk-or.html

阅读本文你最好有一定 Unix/Linux 常识.

Some of you may have 2 Disks or 2 Partitions on a Mac, maybe one is a SSD or another HDD.
或许你们有些人在MAC上有2块硬盘,比如一块SSD 和 一块 HDD.

Many of you many want to use them as one cool "Fusion Drive" but I don't. Imagine if your got some trouble with your mac or one driver? how could you copy the data out of the disk on another mac or pc? I guess you can't. those drivers need each other to work as one cool driver. so it's a risk for me.
As result, I choose the old school style, the unix traditional style, mount them to different mount points. I'll use SSD as a system driver and HDD for user data.
put it sample:
SSD mount as /
HDD mount as /Users
and it's still fast! (Except you are a HD video editor)

/Users Folder is the place hold your Documents, Videos, Music, app settings, game saves. downloaded items. so it don't need to be very fast, since the program or APPs is in SSD.

或许大多数人会想到使用 "Fusion Drive" 这个 Apple 推出的 COOL玩意儿来使用这2块硬盘,但我不想这么做,因为想到如果MAC出了什么状况,或者有一块盘坏了,怎么办?我能不能把盘拿出来放到其他机器上拯救数据呢?不能吧?因为他们必须聚集Fuse在一起才能使用。所以我还是打算使用UNIX的传统方法来使用这2块硬盘。也就是Mount到不通的 Mount Point 上。简单来说
SSD mount as /
HDD mount as /Users
这样依然是很快的。(除非你的MAC是用来制作 HD 录像的)

/Users 目录是存放你 文档 音乐 电影 程序配置,游戏存档,和下载内容的地方。所以他的读写速度不用很快,由于程序本地还是在SSD内,程序启动速度依然是很快的。


maybe you want the symbol link but I use the mount one.
或许你可以用讨巧的 ln -s 但是我还是介绍正统的方法。

HOW TO (on OSX 10.9)

1. Reinstall your OSX on the new SSD. this will make the SSD as / (Skip if you are already on SSD)
1. 重新在 SSD 上安装 OSX, 这样你的 / 目录就是 SSD了(如果系统已经在 SSD上请跳过)

2. format the HDD by disk utility with "Mac OS Extended (Journaled)" format.
2. 使用系统自带的Disk Utility(磁盘工具)格式化 HDD, 文件系统格式使用"Mac OS Extended (Journaled)"

3.Enable root account
enter "terminal" in the search filed of the top bar to access command line.
enter text below
sudo passwd root
them enter your current account password, them the new password for root user.
them open system preference => users & groups
unlock the settings and hit "Login option"  them check "name and password"

3. Root 你的 mac
在顶上搜索栏搜索 "terminal" 回车会进入命令行界面
输入以下文字
sudo passwd root
先输入你当前账号的密码,然后输入 root 账号的新密码
然后再进入system preference 系统偏好设置 => users & groups 用户和组
接触锁定,然后点击 "Login option 登录选项"  选择 "name and password 用户名和密码"
(由于本人使用英文界面,中文翻译都是猜测 不一定准确. 意思对了就好)

4. Logout or restart them login as root with your new password
4. 登出或者重启后使用root账号登录,密码就是你刚才设置的密码

5. User terminal enter following commands
5. 再次使用命令行输入如下命令

cd /
mv /Users /Users.old
mkdir /Users
chown root:admin /Users
chmod 755 /Users


6. Get the Partition UUID that your want to mount on /Users
    in Disk Utility select the partition and click the Blue "i" info button and copy the value of "Universal Unique Identifier"
6. 找到HDD里那个分区的 UUID
    在Disk Utitly磁盘工具 中找到 HDD里那个分区,点击分区,然后点击上面菜单上那个蓝色"i"按钮,并复制 "Universal Unique Identifier" 里拿一串值。


7. create the file /etc/fstab as follow
7. 创建 /etc/fstab 文件,犹如下面的例子

in Command line type (命令行下输入)
touch /etc/fstab
open /etc/fstab

make sure the file looks like this and save (文件里就下面一行,然后save)

UUID=BA5FDDDD-FFE8-3E03-A55F-004E3F36EA66 /Users hfs auto

Replace the red with your UUID.
把红字换成你的 UUID 就好了


8. Mount your HDD to the /Users
in Disk Utility, Unmount the Partition you want by press the umount button and remount it. and it will become /Users
8. Mount 你的 HDD 到 /Users
在磁盘管理工具 Disk Utility 中,选中你要的分区 Unmount(按钮)然后 再 Mount(按钮) (Mount 中文可能叫做挂载) 便能时间 HDD Mount 到 /Users 上.

9. Copy All old User data to new location by following commands
9. COPY原来的用户配置到新的地方 使用以下命令
cp -a /Users.old/ /Users/

10. Reboot and login as normal user
10. 重启使用原来的用户登录

11. IF it's OK, delete the /Users.old and disable root account login. (you should not use root account if you have to )
11. 如果都 OK 你可以删除 /Users.old 目录 并改回原来的登录方式,防止滥用 root 权利.

sudo rm -rf /Users.old


TOP

posted by wap, platform: Safari

分区本来就该是这么用的嘛~~
不过我倒觉得User目录不该弄到HDD上去~



TOP

posted by wap, platform: iPhone
引用:
原帖由 @wpang  于 2014-3-31 00:59 发表
posted by wap, platform: Safari

分区本来就该是这么用的嘛~~
不过我倒觉得User目录不该弄到HDD上去~
除了 Users 需要巨大空间没有其他地方需要啦


TOP

posted by wap, platform: Chrome

何苦......
附件: 您所在的用户组无法下载或查看附件

TOP

发新话题
     
官方公众号及微博