![我如何检测安装的 Lubuntu 的重复版本?](https://linux22.com/image/1160409/%E6%88%91%E5%A6%82%E4%BD%95%E6%A3%80%E6%B5%8B%E5%AE%89%E8%A3%85%E7%9A%84%20Lubuntu%20%E7%9A%84%E9%87%8D%E5%A4%8D%E7%89%88%E6%9C%AC%EF%BC%9F.png)
当我启动时,列出了六个选项,但我想也许应该只有四个?1+2 和 5+6 似乎指的是不同的 Lubuntu 版本。
- Ubuntu
- Ubuntu 的高级选项
- 记忆测试
- 内存测试串行控制台
- Ubuntu 18.04.1 LTS(/dev/sd65 上的 18.04)
- Ubuntu 18.04.1 LTS(/dev/sd65 上的 18.04)的高级选项
5 和 6 似乎提示我使用一个我放弃的用户名,因为我不允许我进行更新(由于未知原因的一些超小分区)并且进行了全新安装,从而清除了 Windows Vista 以及我第一次安装的 Lubuntu。
这似乎是它的回响,我想清理空间并避免混淆。文件管理器 PCManFM 提到 3.7 GB 的卷可能是罪魁祸首。
注释和系统信息
当我的电脑自动启动时,它会停留在黑屏上,并且不会进入登录屏幕。从启动菜单中选择“高级”,然后选择“恢复模式”,再选择“恢复正常启动”,似乎可以打开它,但我不知道在哪里。
当我进入“高级”时,现在有 4 个选项(昨天只有 2 个!)用于 4.15.0-34 和 4.15-0.29 的正常/恢复。我选择了 34,因为这听起来像是较新的更新。如果进入 Ubuntu 18.04.1 LTS 的高级选项,也会显示 4.15.0.29 版本。如果 29 已过时,我想删除两个 29,只运行 34,但不要让它进入黑屏,即使这意味着它每次启动时都会自动运行恢复模式,而不是非恢复模式。
$ sudo lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1
├─LVM2_m GNFcFZ-msHQ-7StI-abZJ-sNGC-LFnZ-k0RfGA
├─lubuntu--vg-root ext4 082b416e-387c-41f5-89c2-a2346900e7e4 /
└─lubuntu--vg-swap_1 swap afc0be1d-6a95-487c-9168-eb0d410faf3e [SWAP]
sdb
├─sdb1 ntfs HP_PAVILION Adjacent Reserve 1/2 24483AB0483A809A /media/jay
├─sdb2
└─sdb5 ext4 7a6647ec-d9ef-456f-9a47-baf96238738e /media/jay
sr0
$ sudo os-prober
/dev/sdb5:Ubuntu 18.04.1 LTS (18.04):Ubuntu:linux
/boot/grub/grub.cfg
:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
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
# GRUB lacks write support for lvm, so recordfail support is disabled.
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_CA
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 10 ; then
set timeout=0
fi
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 ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-082b416e-387c-41f5-89c2-a2346900e7e4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
linux /boot/vmlinuz-4.15.0-34-generic root=/dev/mapper/lubuntu--vg-root ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-34-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-082b416e-387c-41f5-89c2-a2346900e7e4' {
menuentry 'Ubuntu, with Linux 4.15.0-34-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-34-generic-advanced-082b416e-387c-41f5-89c2-a2346900e7e4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
echo 'Loading Linux 4.15.0-34-generic ...'
linux /boot/vmlinuz-4.15.0-34-generic root=/dev/mapper/lubuntu--vg-root ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-34-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-34-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-34-generic-recovery-082b416e-387c-41f5-89c2-a2346900e7e4' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
echo 'Loading Linux 4.15.0-34-generic ...'
linux /boot/vmlinuz-4.15.0-34-generic root=/dev/mapper/lubuntu--vg-root ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-34-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-29-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-29-generic-advanced-082b416e-387c-41f5-89c2-a2346900e7e4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
echo 'Loading Linux 4.15.0-29-generic ...'
linux /boot/vmlinuz-4.15.0-29-generic root=/dev/mapper/lubuntu--vg-root ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-29-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-29-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-29-generic-recovery-082b416e-387c-41f5-89c2-a2346900e7e4' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
echo 'Loading Linux 4.15.0-29-generic ...'
linux /boot/vmlinuz-4.15.0-29-generic root=/dev/mapper/lubuntu--vg-root ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-29-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/HORLtD-crE4-d90f-Nthf-cpUz-pHKh-jjsFCl/bHSqxy-di5E-WSMS-HeIu-XBEx-XCn3-CNMu0O' 082b416e-387c-41f5-89c2-a2346900e7e4
else
search --no-floppy --fs-uuid --set=root 082b416e-387c-41f5-89c2-a2346900e7e4
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Ubuntu 18.04.1 LTS (18.04) (on /dev/sdb5)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7a6647ec-d9ef-456f-9a47-baf96238738e' {
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 7a6647ec-d9ef-456f-9a47-baf96238738e
else
search --no-floppy --fs-uuid --set=root 7a6647ec-d9ef-456f-9a47-baf96238738e
fi
linux /boot/vmlinuz-4.15.0-29-generic root=UUID=7a6647ec-d9ef-456f-9a47-baf96238738e ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-29-generic
}
submenu 'Advanced options for Ubuntu 18.04.1 LTS (18.04) (on /dev/sdb5)' $menuentry_id_option 'osprober-gnulinux-advanced-7a6647ec-d9ef-456f-9a47-baf96238738e' {
menuentry 'Ubuntu (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-29-generic--7a6647ec-d9ef-456f-9a47-baf96238738e' {
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 7a6647ec-d9ef-456f-9a47-baf96238738e
else
search --no-floppy --fs-uuid --set=root 7a6647ec-d9ef-456f-9a47-baf96238738e
fi
linux /boot/vmlinuz-4.15.0-29-generic root=UUID=7a6647ec-d9ef-456f-9a47-baf96238738e ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-29-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-29-generic (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-29-generic--7a6647ec-d9ef-456f-9a47-baf96238738e' {
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 7a6647ec-d9ef-456f-9a47-baf96238738e
else
search --no-floppy --fs-uuid --set=root 7a6647ec-d9ef-456f-9a47-baf96238738e
fi
linux /boot/vmlinuz-4.15.0-29-generic root=UUID=7a6647ec-d9ef-456f-9a47-baf96238738e ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-29-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-29-generic (recovery mode) (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-29-generic-root=UUID=7a6647ec-d9ef-456f-9a47-baf96238738e ro recovery nomodeset-7a6647ec-d9ef-456f-9a47-baf96238738e' {
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 7a6647ec-d9ef-456f-9a47-baf96238738e
else
search --no-floppy --fs-uuid --set=root 7a6647ec-d9ef-456f-9a47-baf96238738e
fi
linux /boot/vmlinuz-4.15.0-29-generic root=UUID=7a6647ec-d9ef-456f-9a47-baf96238738e ro recovery nomodeset
initrd /boot/initrd.img-4.15.0-29-generic
}
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### 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 ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
答案1
sudo lsblk -f
您可以使用和的输出sudo os-prober
来检测可用的 Linux 安装并将它们与当前正在运行的安装区分开来。
操作系统探测器在 上找到一个 Ubuntu 安装
/dev/sdb5
。奇怪的是,它没有找到当前正在运行的安装(稍后会详细介绍)。
lsblk显示虚拟卷
lubuntu--vg-root
已安装在/
,这意味着它是当前正在运行的 Ubuntu/Linux 安装的(主要)位置。它还显示了 上的交换分区lubuntu--vg-swap_1
。它还显示两个虚拟卷都由驱动器分区支持/dev/sdb1
(尽管省略了完整路径)。lsblk
sdb5
还显示了属于不同 Ubuntu/Linux 安装的ext4 文件系统操作系统探测器。
您可以使用您最喜欢的分区管理器安全地格式化或删除文件系统 UUID 为 7a6647ec-d9ef-456f-9a47-baf96238738e 的分区/dev/sdb5
,然后运行sudo update-grub
以更新 Grub 菜单。显然,您将在此过程中丢失该分区上的所有数据。