分區 - 如何為Windows和Ubuntu雙啟動創建一個"共享/home"分區?

分享于 

4分钟阅读

ubuntu

  简体



我创建了一个Ubuntu和Windows都可以使用的NTFS分区。

列出当前设置


$ lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL |egrep -v "^loop"



NAME FSTYPE LABEL MOUNTPOINT SIZE MODEL


nvme0n1 477G Samsung SSD 960 PRO 512GB 


├─nvme0n1p9 swap [SWAP] 7.9G 


├─nvme0n1p7 ext4 Old_Ubuntu_16.04 /mnt/old 23.1G 


├─nvme0n1p5 ntfs 859M 


├─nvme0n1p3 16M 


├─nvme0n1p1 ntfs 450M 


├─nvme0n1p8 ntfs Shared_WSL+Linux /mnt/e 9G 


├─nvme0n1p10 ext4 Ubuntu_18.04 /mnt/clone 27.2G 


├─nvme0n1p6 ext4 New_Ubuntu_16.04 / 45.1G 


├─nvme0n1p4 ntfs NVMe_Win10 /mnt/c 363.2G 


└─nvme0n1p2 vfat /boot/efi 99M 


sr0 1024M DVD+/-RW DW316 


sda 931.5G HGST HTS721010A9


├─sda4 ntfs WINRETOOLS 450M 


├─sda2 128M 


├─sda5 ntfs Image 11.4G 


├─sda3 ntfs HGST_Win10 /mnt/d 919G 


└─sda1 vfat ESP 500M 



注意Ubuntu+Windows 10共享分区:


nvme0n1p8 ntfs Shared_WSL+Linux /mnt/e 9G 



获取UUID

要获取UUID,请使用:


$ lsblk -o NAME,LABEL,TYPE,UUID |egrep -v "^loop"



NAME LABEL TYPE UUID


nvme0n1 disk 


├─nvme0n1p9 part b4512bc6-0ec8-4b17-9edd-88db0f031332


├─nvme0n1p7 Old_Ubuntu_16.04 part f3f8e7bc-b337-4194-88b8-3a513f6be55b


├─nvme0n1p5 part C0C65F23C65F18CC


├─nvme0n1p3 part 


├─nvme0n1p1 part 7040FA5240FA1F12


├─nvme0n1p8 Shared_WSL+Linux part F2C2ACE4C2ACADF3


├─nvme0n1p10 Ubuntu_18.04 part 8337e8c8-6461-44f2-b5fe-dfd5b6b05883


├─nvme0n1p6 New_Ubuntu_16.04 part b40b3925-70ef-447f-923e-1b05467c00e7


├─nvme0n1p4 NVMe_Win10 part 5CCC5867CC583E08


└─nvme0n1p2 part D656-F2A8


sr0 rom 


sda disk 


├─sda4 WINRETOOLS part 221A463E1A460F6B


├─sda2 part 


├─sda5 Image part 38D4470BD446CB38


├─sda3 HGST_Win10 part F03ED48E3ED44F6A


└─sda1 ESP part 9478-B6E2




├─nvme0n1p8 Shared_WSL+Linux part F2C2ACE4C2ACADF3



在Ubuntu中更改/etc/fstab文件

共享分区需要在Ubuntu的/etc/fstab文件中进行设置,以便具有写权限正确安装:


$ cat /etc/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/nvme0n1p6 during installation


UUID=b40b3925-70ef-447f-923e-1b05467c00e7 / ext4 errors=remount-ro 0 1


# /boot/efi was on /dev/nvme0n1p2 during installation


UUID=D656-F2A8 /boot/efi vfat umask=0077 0 1


# Windows drives C, D & E


UUID=F2C2ACE4C2ACADF3 /mnt/e ntfs-3g permissions,locale=en_US.utf8,x-gvfs-show 0 0


UUID=F03ED48E3ED44F6A /mnt/d ntfs-3g permissions,locale=en_US.utf8 0 0


UUID=5CCC5867CC583E08 /mnt/c ntfs-3g permissions,locale=en_US.utf8,x-gvfs-show 0 0


# Broken Ubuntu 16.04


UUID=f3f8e7bc-b337-4194-88b8-3a513f6be55b /mnt/old ext4 x-gvfs-show 0 0


# Clone Ubuntu 18.04


UUID=8337e8c8-6461-44f2-b5fe-dfd5b6b05883 /mnt/clone ext4 x-gvfs-show 0 0


# swap was on /dev/nvme0n1p9 during installation


UUID=b4512bc6-0ec8-4b17-9edd-88db0f031332 none swap sw 0 0



注意行:


UUID=F2C2ACE4C2ACADF3 /mnt/e ntfs-3g permissions,locale=en_US.utf8,x-gvfs-show 0 0



  • 将此条目替换成到您自己的UUID


Window  PAR  Windows  BOO  引导  MAKE