更改ubuntu的挂载点

我的是给ubuntu的空间太少了`但是主要工程都是在home下,所以格式化了一个空间来作为home,然后挂载到/下

原文链接在此

http://hi.baidu.com/macroliu_/item/10f00f172f6076078ebde4ba

以root权限,在终端的窗口里输入命令,找到你要挂载的分区,这里以sda5为例

$ fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf517e314

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5222 41945683+ 7 HPFS/NTFS
/dev/sda2 5223 7712 19999744 83 Linux
/dev/sda3 7712 7961 1999872 82 Linux swap / Solaris
/dev/sda4 7962 38913 248621940 5 Extended
/dev/sda5 7962 17687 78124063+ 83 Linux
/dev/sda6 17688 25520 62918541 7 HPFS/NTFS
/dev/sda7 25521 38913 107579241 7 HPFS/NTFS

这里可以看到/dev/sda5,这应该是我想挂载在home下的分区。察看sda5的UUID

$ ls -l /dev/disk/by-uuid

看一下sda5的UUID

总计 0
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 3aa554c2-e8ea-4f35-819f-7cb4573c0d67 -> ../../sda5
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 4E8091348091240D -> ../../sda7
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 7b1c60be-8b84-4459-9bef-9559d9431447 -> ../../sda2
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 8c5324bb-9e42-422d-b507-26bafa5ac7de -> ../../sda3
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 AAA87F76A87F403D -> ../../sda6
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 C478ECC978ECBAF6 -> ../../sda1
将sda5的UUID填到fstab关于home的挂载那一行。


$ vim /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=7b1c60be-8b84-4459-9bef-9559d9431447 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=3aa554c2-e8ea-4f35-819f-7cb4573c0d67 /home ext4 defaults 0 2
# /windows was on /dev/sda6 during installation
# UUID=50C5-059A/windows vfat utf8,umask=007,gid=46 0 1
# swap was on /dev/sda3 during installation
UUID=8c5324bb-9e42-422d-b507-26bafa5ac7de none swap sw 0 0
另外,windows这个挂载点我不需要了,将fstab对应那几行用#号注掉。

恩``那就好了``

这里还顺带解决了开机之后差看不到windows分区的问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值