磁盘阵列上的文件访问不了--原因是lvm不能activate,解决办法
生活随笔
收集整理的這篇文章主要介紹了
磁盘阵列上的文件访问不了--原因是lvm不能activate,解决办法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
磁盤陣列上的文件訪問不了--原因是lvm不能activate,解決辦法 描述: 系統(tǒng)布局如上圖, 現(xiàn),虛擬機上的centos系統(tǒng)突然不能訪問磁盤陣列上的文件。 原有設(shè)計如下: 虛擬機上的centos系統(tǒng)掛載磁盤陣列上的兩個磁盤,multipath成一個設(shè)備,用lvm創(chuàng)建邏輯卷組,再創(chuàng)建兩個文件系統(tǒng),一個為GFS,一個為ext3。 以前運行好好的,前天突然,兩個磁盤都找不到。 用fdsik -l 查看,發(fā)現(xiàn) Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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??????? 2349??? 18763920?? 8e Linux LVM
/dev/sda3??????????? 2350??????? 2610???? 2096482+ 82 Linux swap / Solaris Disk /dev/sdb: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot????? Start???????? End????? Blocks?? Id System Disk /dev/sdc: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdc doesn't contain a valid partition table Disk /dev/sdd: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdd doesn't contain a valid partition table Disk /dev/sde: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes Disk /dev/sde doesn't contain a valid partition table Disk /dev/dm-1: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot????? Start???????? End????? Blocks?? Id System Disk /dev/sdf: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot????? Start???????? End????? Blocks?? Id System
Disk /dev/sdg: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdg doesn't contain a valid partition table Disk /dev/sdh: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdh doesn't contain a valid partition table Disk /dev/sdi: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes Disk /dev/sdi doesn't contain a valid partition table Disk /dev/dm-2: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-2 doesn't contain a valid partition table Disk /dev/dm-3: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-3 doesn't contain a valid partition table 查看/etc/fstab結(jié)果: /dev/VolG_VMCentOS/LogVol_Root /?????????????????????? ext3??? defaults??????? 1 1
LABEL=/boot???????????????????? /boot?????????????????? ext2??? defaults??????? 1 2
tmpfs?????????????????????????? /dev/shm??????????????? tmpfs?? defaults??????? 0 0
devpts????????????????????????? /dev/pts??????????????? devpts gid=5,mode=620 0 0
sysfs?????????????????????????? /sys??????????????????? sysfs?? defaults??????? 0 0
proc??????????????????????????? /proc?????????????????? proc??? defaults??????? 0 0
LABEL=SWAP-sda3???????????????? swap??????????????????? swap??? defaults??????? 0 0 /dev/volg_public_data/lvol_ftp /var/ftp??????????????? gfs2??? defaults,lockproto=lock_nolock 0 0 /dev/volg_samba_users_data/lvol_samba_users_data /home/EMBEDDED ext3??? defaults??????? 0 0 # Beginning of the block added by the VMware software
.host:/???????????????? /mnt/hgfs?????????????? vmhgfs defaults,ttl=5???? 0 0
# End of the block added by the VMware software 在/dev下沒有volg_public_data跟volg_samba_users_data這兩個文件夾。 命令 fsck.gfs2 /dev/mapper/Public_Data_1
Initializing fsck
Either the super block is corrupted, or this is not a GFS2 filesystem fsck.ext3 /dev/mapper/Public_Data_1
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/mapper/Public_Data_1 The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
??? e2fsck -b 8193 <device> fsck.ext3 /dev/mapper/samba_users_data
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/mapper/samba_users_data The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
??? e2fsck -b 8193 <device>
不知道是什么問題
============================================================ 經(jīng)研究發(fā)現(xiàn),前面的分析方法有誤: /dev/mapper/Public_Data_1 上面加了一層lvm,不能直接用fsck來檢查,可以用pvck來檢查,/dev/mapper/Public_Data_1存在而沒有/dev/volg_public_data/lvol_ftp目錄文件是因為改邏輯卷組沒有activate,可以用vgdisplay查看到/dev/mapper/Public_Data_1上的lvm系統(tǒng)是完好的,這時可以用vgchange -ay來activate它,在使用vgchange -ay命令時發(fā)現(xiàn)有Skipping clustered volume group volg_public_data這樣的字符串出現(xiàn),解決辦法是把/etc/lvm/lvm.conf 文件中的locking_type設(shè)置為 0,然后,再用vgchange 命令activate即可。
BTW:若刪除一個ISCSI磁盤,在client的multipath下還是可以看到的,類似于下面的結(jié)果,multipath -ll
sdf: checker msg is "tur checker reports path is down"
sdg: checker msg is "tur checker reports path is down"
web_backup (36001c23000d1a0cf000024e54854a62c) dm-1 DELL,MD3000i
[size=100G][features=0][hwhandler=0]
\_ round-robin 0 [prio=2][active]
\_ 2:0:0:0 sdd 8:48 [active][ready]
\_ 1:0:0:0 sdb 8:16 [active][ready]
mpath5 (1_) dm-3 DELL,MD3000i
[size=1.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][enabled]
\_ 1:0:0:1 sdf 8:80 [active][faulty]
\_ 2:0:0:1 sdg 8:96 [active][faulty] 可以用 echo 1 > /sys/bus/scsi/devices/2\:0\:0\:1/delete echo 1 > /sys/bus/scsi/devices/1\:0\:0\:1/delete multipath -F 命令把他刪掉,再用multipath -ll就沒有了 類似的還有echo 1 > /sys/bus/scsi/devices/2\:0\:0\:1/rescan重新掃描, 舉一反三。。。
255 heads, 63 sectors/track, 2610 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??????? 2349??? 18763920?? 8e Linux LVM
/dev/sda3??????????? 2350??????? 2610???? 2096482+ 82 Linux swap / Solaris Disk /dev/sdb: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot????? Start???????? End????? Blocks?? Id System Disk /dev/sdc: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdc doesn't contain a valid partition table Disk /dev/sdd: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdd doesn't contain a valid partition table Disk /dev/sde: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes Disk /dev/sde doesn't contain a valid partition table Disk /dev/dm-1: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot????? Start???????? End????? Blocks?? Id System Disk /dev/sdf: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot????? Start???????? End????? Blocks?? Id System
Disk /dev/sdg: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdg doesn't contain a valid partition table Disk /dev/sdh: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdh doesn't contain a valid partition table Disk /dev/sdi: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes Disk /dev/sdi doesn't contain a valid partition table Disk /dev/dm-2: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-2 doesn't contain a valid partition table Disk /dev/dm-3: 2186.1 GB, 2186137829376 bytes
255 heads, 63 sectors/track, 265782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-3 doesn't contain a valid partition table 查看/etc/fstab結(jié)果: /dev/VolG_VMCentOS/LogVol_Root /?????????????????????? ext3??? defaults??????? 1 1
LABEL=/boot???????????????????? /boot?????????????????? ext2??? defaults??????? 1 2
tmpfs?????????????????????????? /dev/shm??????????????? tmpfs?? defaults??????? 0 0
devpts????????????????????????? /dev/pts??????????????? devpts gid=5,mode=620 0 0
sysfs?????????????????????????? /sys??????????????????? sysfs?? defaults??????? 0 0
proc??????????????????????????? /proc?????????????????? proc??? defaults??????? 0 0
LABEL=SWAP-sda3???????????????? swap??????????????????? swap??? defaults??????? 0 0 /dev/volg_public_data/lvol_ftp /var/ftp??????????????? gfs2??? defaults,lockproto=lock_nolock 0 0 /dev/volg_samba_users_data/lvol_samba_users_data /home/EMBEDDED ext3??? defaults??????? 0 0 # Beginning of the block added by the VMware software
.host:/???????????????? /mnt/hgfs?????????????? vmhgfs defaults,ttl=5???? 0 0
# End of the block added by the VMware software 在/dev下沒有volg_public_data跟volg_samba_users_data這兩個文件夾。 命令 fsck.gfs2 /dev/mapper/Public_Data_1
Initializing fsck
Either the super block is corrupted, or this is not a GFS2 filesystem fsck.ext3 /dev/mapper/Public_Data_1
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/mapper/Public_Data_1 The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
??? e2fsck -b 8193 <device> fsck.ext3 /dev/mapper/samba_users_data
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/mapper/samba_users_data The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
??? e2fsck -b 8193 <device>
不知道是什么問題
============================================================ 經(jīng)研究發(fā)現(xiàn),前面的分析方法有誤: /dev/mapper/Public_Data_1 上面加了一層lvm,不能直接用fsck來檢查,可以用pvck來檢查,/dev/mapper/Public_Data_1存在而沒有/dev/volg_public_data/lvol_ftp目錄文件是因為改邏輯卷組沒有activate,可以用vgdisplay查看到/dev/mapper/Public_Data_1上的lvm系統(tǒng)是完好的,這時可以用vgchange -ay來activate它,在使用vgchange -ay命令時發(fā)現(xiàn)有Skipping clustered volume group volg_public_data這樣的字符串出現(xiàn),解決辦法是把/etc/lvm/lvm.conf 文件中的locking_type設(shè)置為 0,然后,再用vgchange 命令activate即可。
BTW:若刪除一個ISCSI磁盤,在client的multipath下還是可以看到的,類似于下面的結(jié)果,multipath -ll
sdf: checker msg is "tur checker reports path is down"
sdg: checker msg is "tur checker reports path is down"
web_backup (36001c23000d1a0cf000024e54854a62c) dm-1 DELL,MD3000i
[size=100G][features=0][hwhandler=0]
\_ round-robin 0 [prio=2][active]
\_ 2:0:0:0 sdd 8:48 [active][ready]
\_ 1:0:0:0 sdb 8:16 [active][ready]
mpath5 (1_) dm-3 DELL,MD3000i
[size=1.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][enabled]
\_ 1:0:0:1 sdf 8:80 [active][faulty]
\_ 2:0:0:1 sdg 8:96 [active][faulty] 可以用 echo 1 > /sys/bus/scsi/devices/2\:0\:0\:1/delete echo 1 > /sys/bus/scsi/devices/1\:0\:0\:1/delete multipath -F 命令把他刪掉,再用multipath -ll就沒有了 類似的還有echo 1 > /sys/bus/scsi/devices/2\:0\:0\:1/rescan重新掃描, 舉一反三。。。
轉(zhuǎn)載于:https://blog.51cto.com/ilexes/158648
總結(jié)
以上是生活随笔為你收集整理的磁盘阵列上的文件访问不了--原因是lvm不能activate,解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C#中Escape编码的加密、解密
- 下一篇: 单臂路由实验-VTP