如何开机自动挂载分区

如何开机自动挂载分区

安装 Ubuntu 16.04.1 后,我在硬盘的可用空间上创建了新分区。我无法/dev/mapper/MYVGNAME--vg-images在启动时安装。

df -h输出:

Filesystem                          Size  Used Avail Use% Mounted on
    udev                                474M     0  474M   0% /dev
    tmpfs                                99M  3.2M   96M   4% /run
    /dev/mapper/MYVGNAME--vg-root        24G  1.6G   21G   8% /
    tmpfs                               492M     0  492M   0% /dev/shm
    tmpfs                               5.0M     0  5.0M   0% /run/lock
    tmpfs                               492M     0  492M   0% /sys/fs/cgroup
    /dev/sda1                           472M  101M  347M  23% /boot
    tmpfs                                99M     0   99M   0% /run/user/1000

pvdisplay输出:

 --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               MYVGNAME-vg
  PV Size               126.52 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              32389
  Free PE               0
  Allocated PE          32389
  PV UUID               Xxxyyy-xxXx-XxxX-XXXX-Xxxx-XxXX-XXxXXX

lvdisplay输出:

  --- Logical volume ---
  LV Path                /dev/MYVGNAME-vg/root
  LV Name                root
  VG Name                MYVGNAME-vg
  LV UUID                Xxxyyy-xxXx-XxxX-XXXX-Xxxx-XxXX-XXxXXX
  LV Write Access        read/write
  LV Creation host, time MYHOSTNAME, 2016-09-15 11:08:02 +0200
  LV Status              available
  # open                 1
  LV Size                24.30 GiB
  Current LE             6221
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/MYVGNAME-vg/swap_1
  LV Name                swap_1
  VG Name                MYVGNAME-vg
  LV UUID                Xxxyyy-xxXx-XxxX-XXXX-Xxxx-XxXX-XXxXXX
  LV Write Access        read/write
  LV Creation host, time MYHOSTNAME, 2016-09-15 11:08:03 +0200
  LV Status              available
  # open                 2
  LV Size                1020.00 MiB
  Current LE             255
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Path                /dev/MYVGNAME-vg/images
  LV Name                images
  VG Name                MYVGNAME-vg
  LV UUID                Xxxyyy-xxXx-XxxX-XXXX-Xxxx-XxXX-XXxXXX
  LV Write Access        read/write
  LV Creation host, time MYHOSTNAME, 2016-09-15 14:50:07 +0200
  LV Status              available
  # open                 0
  LV Size                101.22 GiB
  Current LE             25913
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

nano /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>
/dev/mapper/MYVGNAME--vg-root /               ext4    defaults 0       1
# /boot was on /dev/sda1 during installation
UUID=Xxxyyy-xxXx-XxxX-XXXX-Xxxx-XxXX-XXxXXX /boot           ext2    defaults        0       2
/dev/mapper/MYVGNAME--vg-swap_1 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

想要拥有这个:

Filesystem                            Size  Used Avail Use% Mounted on
udev                                  474M     0  474M   0% /dev
tmpfs                                  99M  3.2M   96M   4% /run
/dev/mapper/MYVGNAME--vg-root     24G  1.6G   21G   8% /
tmpfs                                 492M     0  492M   0% /dev/shm
tmpfs                                 5.0M     0  5.0M   0% /run/lock
tmpfs                                 492M     0  492M   0% /sys/fs/cgroup
/dev/sda1                             472M  101M  347M  23% /boot
tmpfs                                  99M     0   99M   0% /run/user/1000
/dev/mapper/MYVGNAME--vg-images  100G   60M   95G   1% /images

答案1

关于什么

/dev/mapper/MYVGNAME--vg-images /images  ext4    defaults 0       1

fstab

(我假设你已经格式化了ext4

相关内容