今天早上,一位用户来找我,让我知道从外部发送的电子邮件没有显示在他的工作邮箱的收件箱中。我们在内部托管电子邮件服务器(不是我的想法)。我通过从我的Gmail帐户发送电子邮件到我的工作电子邮件进行测试,并且正如预期的那样,电子邮件永远不会到达。
我去重新启动邮件服务器(运行Ubuntu 10.10),并且在GRUB引导加载程序启动之前,服务器将重新启动回POST / BIOS“检查内存”消息,好像我已经按下重置按钮。
我去了10.10的副本,并试图运行系统救援,看看我是否能够修复启动问题,但我无法解决它。然后我烧掉了Ubuntu 18.04的副本,看看是否还有其他工具可以让我深入挖掘一下,看看发生了什么。
我检查了当前安装Ubuntu的驱动器上的/ etc / fstab,这是我找到的
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/mailadmin-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda2 during installation
UUID=e8c63c19-db49-4013-bec8-ef8479fb52f1 /boot ext2 defaults 0 2
/dev/mapper/mailadmin-swap_1 none swap sw 0 0
10.6.9.5:/volume1/Backups/Zimbra/TarBackups /zmbackup nfs,size=8192,wsize=8192,timeo=14,intr
注意/ boot分区的UUID上面的注释?我没有输入那个评论,它是几年前由前任IT经理留下的。我修改了/ etc / fstab文件以指向/ dev / sda2(我已确认是grub配置所在的实际位置)而不是UUID,重新启动 - 但服务器仍然进入重启循环,因为它即将加载grub。
在做了一些谷歌搜索后,我找到了一个名为bootinfoscript.sh的脚本,它输出一个文本文件,其中包含一系列与我系统中检测到的硬盘相关的信息。这是bootinfoscript.sh的输出
Boot Info Script 0.61 [1 April 2012]
============================= Boot Info Summary: ===============================
=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
2048 of the same hard drive for core.img. core.img is at this location and
looks in partition 2 for /grub.
=> Syslinux MBR (4.04 and higher) is installed in the MBR of /dev/sdb.
sda1: __________________________________________________________________________
File system: BIOS Boot partition
Boot sector type: Grub2's core.img
Boot sector info:
sda2: __________________________________________________________________________
File system: ext2
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/grub.cfg /grub/core.img
sda3: __________________________________________________________________________
File system: LVM2_member
Boot sector type: -
Boot sector info:
sdb1: __________________________________________________________________________
File system: vfat
Boot sector type: SYSLINUX 6.03
Boot sector info: Syslinux looks at sector 32784 of /dev/sdb1 for its
second stage. The integrity check of Syslinux failed.
No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg /syslinux.cfg
/efi/BOOT/grubx64.efi /ldlinux.sys
mailadmin-root': _______________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed: mount: /tmp/BootInfo-TMXYqs5T/LVM/mailadmin-root': unknown filesystem type ''.
mailadmin-swap_1': _____________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed: mount: /tmp/BootInfo-TMXYqs5T/LVM/mailadmin-root': unknown filesystem type ''.
mount: /tmp/BootInfo-TMXYqs5T/LVM/mailadmin-swap_1': unknown filesystem type ''.
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 10.9 TiB, 11999064883200 bytes, 23435673600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 1 4,294,967,295 4,294,967,295 ee GPT
GUID Partition Table detected.
Partition Start Sector End Sector # of Sectors System
/dev/sda1 2,048 4,095 2,048 BIOS Boot partition
/dev/sda2 4,096 503,807 499,712 Data partition (Windows/Linux)
/dev/sda3 503,808 7,329,544,191 7,329,040,384 Logical Volume Manager (LVM) partition (Linux)
Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 14.4 GiB, 15500574720 bytes, 30274560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sdb1 * 2,048 30,274,559 30,272,512 c W95 FAT32 (LBA)
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/loop0 squashfs
/dev/loop1 squashfs
/dev/loop2 squashfs
/dev/loop3 squashfs
/dev/loop4 squashfs
/dev/loop5 squashfs
/dev/loop6 squashfs
/dev/loop7 squashfs
/dev/mapper/mailadmin-root 3e2b9e3a-7190-4240-804e-f1761fa96ade ext4
/dev/mapper/mailadmin-swap_1 2b7f558a-2abe-4981-879e-d79f7ed3fb01 swap
/dev/sda1
/dev/sda2 e8c63c19-db49-4013-bec8-ef8479fb52f1 ext2
/dev/sda3 WFe0Xa-LXJa-BzOr-Oyo9-kC5E-3W7p-qWA5Uy LVM2_member
/dev/sdb1 6045-3252 vfat UBUNTU 18_0
========================= "ls -R /dev/mapper/" output: =========================
/dev/mapper:
control
mailadmin-root
mailadmin-swap_1
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sdb1 /cdrom vfat (ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
============================= sda2/grub/grub.cfg: ==============================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set e8c63c19-db49-4013-bec8-ef8479fb52f1
set locale_dir=($root)/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set e8c63c19-db49-4013-bec8-ef8479fb52f1
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set e8c63c19-db49-4013-bec8-ef8479fb52f1
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
--------------------------------------------------------------------------------
=================== sda2: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
=========================== sdb1/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set timeout=5
menuentry "Try Ubuntu without installing" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash ---
initrd /casper/initrd.lz
}
menuentry "Install Ubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash ---
initrd /casper/initrd.lz
}
menuentry "OEM install (for manufacturers)" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash oem-config/enable=true ---
initrd /casper/initrd.lz
}
menuentry "Check disc for defects" {
set gfxpayload=keep
linux /casper/vmlinuz boot=casper integrity-check quiet splash ---
initrd /casper/initrd.lz
}
--------------------------------------------------------------------------------
============================== sdb1/syslinux.cfg: ==============================
--------------------------------------------------------------------------------
DEFAULT loadconfig
LABEL loadconfig
CONFIG /isolinux/isolinux.cfg
APPEND /isolinux/
--------------------------------------------------------------------------------
=================== sdb1: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
================= sdb1: Location of files loaded by Syslinux: ==================
GiB - GB File Fragment(s)
======================== Unknown MBRs/Boot Sectors/etc: ========================
Unknown BootLoader on mailadmin-root'
Unknown BootLoader on mailadmin-swap_1'
=============================== StdErr Messages: ===============================
cat: /tmp/BootInfo-TMXYqs5T/Tmp_Log: No such file or directory
cat: /tmp/BootInfo-TMXYqs5T/Tmp_Log: No such file or directory
cat: /tmp/BootInfo-TMXYqs5T/Tmp_Log: No such file or directory
Failed to find logical volume "mailadmin/root'"
Failed to find logical volume "mailadmin/root'"
Failed to find logical volume "mailadmin/root'"
hexdump: /dev/mapper/mailadmin-root': No such file or directory
hexdump: /dev/mapper/mailadmin-root': No such file or directory
Failed to find logical volume "mailadmin/swap_1'"
Failed to find logical volume "mailadmin/swap_1'"
Failed to find logical volume "mailadmin/swap_1'"
hexdump: /dev/mapper/mailadmin-swap_1': No such file or directory
hexdump: /dev/mapper/mailadmin-swap_1': No such file or directory
仅仅为了一些背景信息,/ dev / sda是一个12TB分区,其中安装了邮件服务器软件。 / dev / sdb是我安装Ubuntu的16GB USB拇指驱动器。
我安装了12TB(实际上是一个RAID阵列)/ dev / sda1驱动器,当我浏览到安装的驱动器上的/ boot文件夹时,好像/ boot目录完全是空的!
任何人都知道这里发生了什么?有没有办法在这台旧服务器上修复grub引导加载程序?
如果您需要任何其他详细信息,请与我们联系。
/dev/sda2
?这个事实 boot
在屏幕截图中是空的并不奇怪,只有在此阶段手动安装它时才会填充它。
/dev/sda
是原始设备,而不是分区。如果你装载,你会看到什么?/dev/sda1
和/dev/sda2
分别?