分页: 1 / 1

root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:00
eaglewarrior
自开启root用户后,就很少用那个装Ubuntu时建的用户名登录。但我的“/home”单独挂了个40GB的较大分区,本用来存各类数据。可用root用户登录后,各类数据默认保存在“/”所挂分区的/root文件夹,而我这个“/”区只分了15GB,心想用来存些程序应该够了。现在用root登录的多,请问大家有没有办法让/root文件夹的内容自动保存在/home所挂的分区啊

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:10
monk
root用户下建个文件夹 把/home的分区挂上

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:11
monk
新手不建议用 root用户

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:21
pointer指针
还是没事干不要root的好……

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:25
eaglewarrior
新手用root用户有什么危险吗?容易不小心操作导致系统崩溃吗?现在基本处于抄别人代码执行的水平,虽自己想不到,但也在琢磨其所以然。麻烦告诉我怎么在root用户下建个文件夹 把/home的分区挂上

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:30
monk
去“教学和常见问答”看看 8哥的 fstab挂载

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:34
onshoestring
ln -s /home /root/新文件夹

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:36
adagio
有什么危险? 简单说吧,使用root账号作为日常使用,将使linux变得比windows还要脆弱,还要不堪一击,linux对windows的优势将不复存在
既然又危险、又没有windows的软件多、又不普及,那你用它做什么?

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:39
pointer指针
eaglewarrior 写了:新手用root用户有什么危险吗?容易不小心操作导致系统崩溃吗?现在基本处于抄别人代码执行的水平,虽自己想不到,但也在琢磨其所以然。麻烦告诉我怎么在root用户下建个文件夹 把/home的分区挂上
home分区了么?
fdisk -l 看看sdax (x是数字) 里面有没有和你的home分区的大小相符的
在root下新建个文件夹,然后终端以root执行:
mount /dev/sdax /root/file/of/your/directory
就可以把home挂载上去
其实你直接把你需要的文件copy过去就好了啊……或者link过去
干吗非要挂载呢

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:43
onshoestring
直接mount可能不合适,因为分区挂栽到目录,就是说/home分区会挂载两次。
可以试试:
The bind mounts.
Since Linux 2.4.0 it is possible to remount part of the file
hierarchy somewhere else. The call is
mount --bind olddir newdir
or shortoption
mount -B olddir newdir
or fstab entry is:
/olddir /newdir none bind

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 0:49
pointer指针
onshoestring 写了:直接mount可能不合适,因为分区挂栽到目录,就是说/home分区会挂载两次。
可以试试:
The bind mounts.
Since Linux 2.4.0 it is possible to remount part of the file
hierarchy somewhere else. The call is
mount --bind olddir newdir
or shortoption
mount -B olddir newdir
or fstab entry is:
/olddir /newdir none bind
嗯嗯,受教 :em11

Re: root用户登录时,/root文件夹的数据如何自动挂载到/home所在分区

发表于 : 2011-05-01 1:03
onshoestring
pointer指针 写了:
onshoestring 写了:直接mount可能不合适,因为分区挂栽到目录,就是说/home分区会挂载两次。
可以试试:
The bind mounts.
Since Linux 2.4.0 it is possible to remount part of the file
hierarchy somewhere else. The call is
mount --bind olddir newdir
or shortoption
mount -B olddir newdir
or fstab entry is:
/olddir /newdir none bind
嗯嗯,受教 :em11
不敢当,其实都是man的结果。