解决硬盘挂载报错:
mount: unknown filesystem type 'LVM2_member'
mount: you must specify the filesystem type
情况说明:
客户托管的服务器到机房,系统是Linux,无法启动,只能做系统恢复。询问后得知:
- 数据盘有数据。无法全格。
- 客户是小白,对Linux一点不懂。(既不懂如何管理)?
我的解决思路(保险起见):
上一块500G新硬盘,做上linux系统。将先前那块磁盘挂上去,之后拷贝数据。
下面开始。
查看磁盘情况:
[root@renwole-com ~]# fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000a9411 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 6553 52428800 83 Linux /dev/sda3 6553 7075 4194304 82 Linux swap / Solaris /dev/sda4 7075 60802 431557656 5 Extended /dev/sda5 7076 60802 431556608 83 Linux Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xa154a154 Device Boot Start End Blocks Id System /dev/sdb1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sdb2 64 60802 487873536 8e Linux LVM Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/VolGroup-lv_home: 441.8 GB, 441765068800 bytes 255 heads, 63 sectors/track, 53708 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 ...
说明:红色部分是以前系统坏的老盘。
安装 lvm2:
[root@renwole-com ~]# yum install lvm2 -y
查看物理卷:
[root@renwole-com ~]# pvs PV VG Fmt Attr PSize PFree /dev/sdb2 VolGroup lvm2 a--u 465.27g 0
查看卷组:
[root@renwole-com ~]# lvdisplay --- Logical volume --- LV Path /dev/VolGroup/lv_root LV Name lv_root VG Name VolGroup LV UUID 3Y5UYD-x0H9-F25h-foUz-rm0O-cgzl-pE8FbF LV Write Access read/write LV Creation host, time localhost.localdomain, 2015-07-20 17:29:35 +0800 LV Status available # open 0 LV Size 50.00 GiB Current LE 12800 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/VolGroup/lv_home LV Name lv_home VG Name VolGroup LV UUID Eu7UKx-LPkM-RDQ6-ACym-KOOW-t2RC-oVq0Zn LV Write Access read/write LV Creation host, time localhost.localdomain, 2015-07-20 17:29:56 +0800 LV Status available # open 1 LV Size 411.43 GiB Current LE 105325 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Logical volume --- LV Path /dev/VolGroup/lv_swap LV Name lv_swap VG Name VolGroup LV UUID PBkdrg-lhsO-vkde-RvC0-ryUh-p0pf-aMnBds LV Write Access read/write LV Creation host, time localhost.localdomain, 2015-07-20 17:32:40 +0800 LV Status available # open 0 LV Size 3.84 GiB Current LE 984 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2
激活卷组:
[root@renwole-com ~]# vgchange -ay /dev/VolGroup 3 logical volume(s) in volume group "VolGroup" now active
挂载硬盘:
[root@renwole-com ~]# mount /dev/VolGroup/lv_home /apps/
/apps是我新建的目录。
查看挂载情况:
[root@renwole-com ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 50G 2.1G 45G 5% / tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 194M 34M 151M 19% /boot /dev/sda5 406G 199M 385G 1% /home /dev/mapper/VolGroup-lv_home 405G 199M 385G 1% /apps
进入apps目录一看,哇;数据还在,可喜可贺呀。
另外:如果挂载报错:
mount: you must specify the filesystem type
可以使用以下方法查看磁盘格式类型,然后加参数 -t
指定格式挂载即可。
[root@renwole-com ~]# file -s /dev/sda1 /dev/sda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (huge files)
重要说明:
未找到合适的解决方案前,切勿对硬盘删分区,否则会损坏数据。
即便挂载成功,切勿使用mv或rm命令,请使用cp命令。
特别注意:在Linux下,若使用软件恢复数据,几乎是不现实的。