关于ubuntu开机自动挂载硬盘

本文介绍了一种解决根分区硬盘空间不足的方法:通过在/etc/fstab中添加一行配置来实现另一块硬盘的自动挂载,将其挂载到/mnt目录下以扩展可用空间。文章详细解释了配置项的具体含义,并分享了实践过程中遇到的问题及解决办法。

根分区的硬盘空间不够了,查了下ext4格式,IRC上说不能合并分区,软链接也不行,后来我决定采用开机自动挂载,把另一块硬盘空间挂到/mnt下。

方法很简单,就是在/etc/fstab里再添一行UUID=13d28f10-fe93-4719-9ab0-4985c0015b73    /mnt         ext4  defaults    0       2

按顺序来分别是:

1硬盘的UUID.

2挂载点.

3文件格式.   ext4 

4挂载选项,这里我选的默认.

5选择是否用dump程序

 is  used  for  these  filesystems  by  the dump(8)  command  to determine which filesystems need to be dumped.  

If the fifth field is not present, a value of zero is  returned  and  dump will assume that the filesystem does not need to be dumped.

6选择是否用fsck程序检测。。。

         sixth is used by the fsck(8) program to determine the order in which filesystem checks

         are done at reboot time.  The

       root  filesystem  should  be specified with a fs_passno of 1, and other
       filesystems should have a fs_passno of 2.  Filesystems within  a  drive
       will  be checked sequentially, but filesystems on different drives will
       be checked at the same time to utilize  parallelism  available  in  the
       hardware.   If  the sixth field is not present or zero, a value of zero
       is returned and fsck will assume that the filesystem does not  need  to
       be checked.

期间犯了很多错误导致没有挂载成功,一开始挂载点设置的 /home,结果是把默认用户设在了挂载分区里,

结果可想而知,把默认用户改在了新分区。

 总之,不懂命令就多man,没有错~~ 

转载于:https://www.cnblogs.com/sunt/archive/2011/01/20/1940710.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值