读书人

Ubuntu将新增磁盘挂载到home上

发布时间: 2012-09-28 00:03:35 作者: rapoo

Ubuntu将新增磁盘挂载到home下

home磁盘空间不足,其他闲置硬盘是原来windows的,不能直接使用(磁盘格式及权限等原因),比如编译安卓源码等。

?

这样的话就需要将新的磁盘格式化成fat32后挂载到/home下的一个目录,这样就可以方便使用啦。

?

具体步骤如下:

?

1.格式化磁盘:

?

a.使用命令:

?

sudo mkfs -t ext3 /dev/sdb1

?

如果执行后开始出现进度就是正在执行,需要等待,是需要时间的。

?

最后显示如下:

?

mke2fs 1.41.14 (22-Dec-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks12804096 inodes, 51199147 blocks2559957 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=01563 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872Writing inode tables: done                            Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 36 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.

?就表明成功了。

?

b.sdb1是用df命令查看出的,列出了已挂载的设备列表。

?

如果执行a的时候出现如下提示:

?

mke2fs 1.41.14 (22-Dec-2010)/dev/sdb1 is mounted; will not make a filesystem here!

?说明这个磁盘已挂载需要取消挂载:

?

执行命令:

?

sudo umount /dev/sdb1

?

注意:是umount,不是unmount !

?

执行完这个命令后再执行a即可。

?

c.不能直接将磁盘挂载到home下,只能先挂载到mnt下:

?

执行命令挂载到/mnt下:

?

sudo chmod 777 -R /mnt/dir
?
 ln -s /mnt/dir ~/dir这个是把/mnt/dir建一个软链接到主目录下的dir目录上以后你只要在主目录下打开dir也就直接访问到了/mnt/dir了。

?

ok,现在进入你的home下的dir目录为所欲为吧,哈哈。

?

读书人网 >操作系统

热点推荐