markdown 如何更改主分区

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何更改主分区相关的知识,希望对你有一定的参考价值。

# How to change home partition

1. Create a New Partition

2. Copy Home Files to New Partition

```
$ sudo cp -Rp /home/* /mount/location
```

   NOTE: You’ll see an error about a .gvfs directory – this is normal; you can ignore it.

   You should check the new home directory to verify it contains your files.

3. Locate the New Partition’s UUID

   The long, random-looking string above is actually the partition’s UUID, and we’ll need it to add the partition to our fstab file, which tells Linux where to mount partitions when it boots. You can also locate the partition’s UUID by running the following command in a terminal:

```
$ sudo blkid
```

4. Modify the fstab File

```
$ sudo cp /etc/fstab /etc/fstab.backup
$ sudo vim /etc/fstab
```

   Add the following text to the fstab file on a new line, replacing the _____ portion with the full UUID of your new home partition from the sudo blkid command above:

```
 UUID=_____     /home     ext4     nodev,nosuid     0     2
```
   Save the file after adding the line.

5. Move Home Directory & Restart

```
$ cd / && sudo mv /home /home_old && sudo mkdir /home
$ sudo shutdown -r now
```

6. Clean Up

   After restarting your computer, you should be able to log in normally. Ubuntu is now using the separate home partition. After making sure that everything went okay and you still have all your files in your /home directory – just in case – you can you can remove your /home_old directory to free up space:

```
$ sudo rm -rf /home_old
```

以上是关于markdown 如何更改主分区的主要内容,如果未能解决你的问题,请参考以下文章

如何更改分区排序?(严重性)

如何更改分区排序?(严重性)

编译安装的mysql如何更改文件路径

如何更改linux中磁盘分区的ID标记号,想把标记为83的改为8e。也就是该为LVM类型的。请高手指教,在线等。

ubuntu 中怎么解决root用户下除主分区外其他文件系统的权限问题?

Ubuntu下如何调整主分区大小