Linux系统分区为LVM格式的挂载方法

在Linux系统中,SCSI磁盘最八只帮助十四个分区(3个主分区sda1-sda3 +
1个扩充裕区sda4 + 拾个逻辑分区sda5-sda15),而IDE磁盘也只援助六17个分区

明天上了个Oracle仓库储存数据备份还原挂载存款和储蓄新硬盘,装完系统后让机房技能把旧硬盘挂上去,大家那边远程操作拷贝数据到新的硬盘上边,在mount
/dev/sda2 /mnt的时候,提示“mount: /dev/sda2 already mounted or /mnt busy
” 核算/dev/sda2一贯不被挂载/mnt也尚未在动用

 

 #fdisk -l /dev/sda
 Disk /dev/sda: 320.0 GB, 320072933376 bytes
 255 heads, 63 sectors/track, 38913 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes
 Device Boot Start End Blocks Id System
 /dev/sda1 * 1 13 104391 83 Linux
 /dev/sda2 14 38913 312464250 8e Linux LVM
 是lvm分区,这种不能够直接被挂载。
 精确挂载流程:
 #fdisk -lu /dev/sda

  1. [root@rhel6 ~]# fdisk -l /dev/sda
  2. Disk /dev/sda: 6442 MB, 6442450944 bytes
  3. 16 heads, 63 sectors/track, 12483 cylinders
  4. Units = cylinders of 1008 * 512 = 516096 bytes
  5. Sector size (logical/physical): 512 bytes / 512 bytes
  6. I/O size (minimum/optimal): 512 bytes / 512 bytes
  7. Disk identifier: 0x00053d18
    1. Device Boot Start End Blocks Id System
  8. /dev/sda1 * 1 104 51200 83 Linux
  9. /dev/sda2 104 11076 5529600 8e Linux LVM
  10. /dev/sda3 11076 12116 524288 82 Linux swap / Solaris
  11. /dev/sda4 12116 12483 185320 5 Extended
  12. /dev/sda5 12116 12136 10400+ 83 Linux
  13. /dev/sda6 12137 12157 10552+ 83 Linux
  14. /dev/sda7 12158 12178 10552+ 83 Linux
  15. /dev/sda8 12179 12199 10552+ 83 Linux
  16. /dev/sda9 12200 12220 10552+ 83 Linux
  17. /dev/sda10 12221 12241 10552+ 83 Linux
  18. /dev/sda11 12242 12262 10552+ 83 Linux
  19. /dev/sda12 12263 12283 10552+ 83 Linux
  20. /dev/sda13 12284 12304 10552+ 83 Linux
  21. /dev/sda14 12305 12325 10552+ 83 Linux
  22. /dev/sda15 12326 12346 10552+ 83 Linux
  23. /dev/sda16 12347 12367 10552+ 83 Linux
    1. [root@rhel6 ~]# mkfs.ext4 /dev/sda16 //固然可以划出17个以上的分区,但无能为力格式化使用
  24. mke2fs 1.41.12 (17-May-2010)

  25. Could not stat /dev/sda16 — No such file or directory
  26. The device apparently does not exist; did you specify it correctly?
    1. [root@rhel6 ~]# ls /dev/sda16
  27. ls: cannot access /dev/sda16: No such file or directory

Disk /dev/sda: 320.0 GB, 320072933376 bytes
 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
 Units = sectors of 1 * 512 = 512 bytes
 
Device Boot Start End Blocks Id System
 /dev/sda1 * 63 208844 104391 83 Linux
 /dev/sda2 208845 625137344 312464250 8e Linux LVM
 //从上收看lvm分区开端于208845扇区,把那个地方处的分区mount为loop设备:
 #losetup -f -o $[208845*512] /dev/sda2
 #losetup -a
 /dev/loop0: [0011]:1050 (/dev/sda2), offset 106928640
 # lvm pvscan //扫描lvm volumns:
 
PV /dev/sda2 VG VolGroup00 lvm2 [297.97 GB / 0 free]
 Total: 1 [297.97 GB] / in use: 1 [297.97 GB] / in no VG: 0 [0 ]
 # lvm vgchange -ay //激活lvm volumn
 2 logical volume(s) in volume group “VolGroup00” now active
 # ls /dev/mapper/ //查看激活后的分区名称
 control VolGroup00-LogVol00 VolGroup00-LogVol01
 # lvm lvs 查看大小
 LV VG Attr LSize Origin Snap% Move Log Copy% Convert
 LogVol00 VolGroup00 -wi-a- 296.03G
LogVol01 VolGroup00 -wi-a- 1.94G
# mount /dev/mapper/VolGroup00-LogVol00 /mnt
 这样就挂载上来了

围绕设备能够把文件虚构成块设备(block
device),以便模拟整个文件系统,那样用户能够将其当做是硬盘驱动器大概光驱等装置,并挂载当作文件系统来利用。

图片 1

Copyright @ 2015-2019 ca88 版权所有
网站地图xml地图