修改檔案系統格式

  1. 查看目前掛載在 /mnt/pub 的 LV 格式為 vfat。
    [root@kvm10 ~]# df -Th /mnt/pub
    Filesystem              Type  Size  Used Avail Use% Mounted on
    /dev/mapper/vg_mnt-pubx vfat   24M     0   24M   0% /mnt/pub
    
  2. 先卸載 /mnt/pub。
    [root@kvm10 ~]# umount /mnt/pub
    
  3. 重新格式化為 ext3,格式化後原來存的資料當然也被清除。
    [root@kvm10 ~]# mkfs.ext3 /dev/vg_mntx/pubx 
    mke2fs 1.44.3 (10-July-2018)
    /dev/vg_mntx/pubx contains a vfat file system
    Proceed anyway? (y,N) y
    Creating filesystem with 24576 1k blocks and 6144 inodes
    Filesystem UUID: 3ae13f81-2156-4680-9848-af37f61aa666
    Superblock backups stored on blocks: 
    	8193
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (1024 blocks): done
    Writing superblocks and filesystem accounting information: done
    
  4. 編輯 /etc/fstab 將要掛載的裝置 vg_mntx-pubx,type 改成 ext3。
    [root@kvm10 ~]# vim /etc/fstab 
    [root@kvm10 ~]# grep /mnt/pub /etc/fstab
    /dev/mapper/vg_mntx-pubx    /mnt/pub         ext3    defaults        1 2
    
  5. 重新依 /etc/fstab 掛載。
    [root@kvm10 ~]# mount -a
    
  6. 成功掛載 vg_mntx-pubx
    [root@kvm10 ~]# df -Th /mnt/pub
    Filesystem               Type  Size  Used Avail Use% Mounted on
    /dev/mapper/vg_mntx-pubx ext3   23M  209K   21M   1% /mnt/pub