分享

将home主目录迁移到/home分区方法

 风动九天 2021-12-22

        在使用linux过程中,有时需要使用/home独立分区。如果在安装过程中没有建立/home分区情况下,则需要通过磁盘分区软件创建/home分区。再将/home主目录迁移到/home分区。网上的方法也不少,但操作比较复杂。今天我以linuxmint为例介绍一种简单方法。

1、创建/home分区,复制home主文件夹。

2、运行磁盘软件,见下图

  3、选中/home分区,点按“其它分区选项”,选中“编辑挂载选项”,修改挂载点为“/home”,其它选项不需操作。见下图:

完成后,大功告成。查看fstab文件已经变化。下面是我的fstab文件内容

# /etc/fstab: static file system information.

#

# Use 'blkid' 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>

# / was on /dev/sdb8 during installation

UUID=193127ce-ded6-447c-a449-631b179438f3 /               ext4    errors=remount-ro 0       1

/swapfile                                 none            swap    sw              0       0

/dev/disk/by-uuid/ca3796ce-61fe-4390-9b12-f121d7cb9a2a /home auto nosuid,nodev,nofail,x-gvfs-show 0 0

/dev/disk/by-uuid/7EBB5A5E0E826558 \040/media/lyx-mint/软件 auto nosuid,nodev,nofail,x-gvfs-show 0 0

绿色部分为/home分区挂载信息。

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多