Grub in a Linux environment that directly re-moves the hard drive

Source: Internet
Author: User

There's a 10-year old mobile drive with a Debian system installed, and it's been a long time since the low version has been upgraded to the current 9. It was a long time ago, when the hard drive was running to Debian to modify the file, an instantaneous connection was interrupted by an avoidable accidental vibration of the data line. Needless to say, it is natural that the system can no longer read and write disk data to various I/O errors and cannot do any work. After the shutdown restart, the boot entry for the removable hard drive disappears from the BIOS shortcut menu and becomes a non-bootable normal disk.

Connect the mobile hard drive to the notebook running openSUSE check, see all the partitions can be correctly recognized, mount after all the partitions can read and write, the files are all alive. To rebuild grub directly, the process is logged as follows:

Open openSUSE terminal, switch to root user

Su -

View all current partitions to determine the Debian root partition location is/DEV/SDB2 (no separate/boot partition)

Lsblk

Mount the Debian root partition

Mount /dev/sdb2/mnt

Mount the other required system directories

Mount --bind/dev/mnt/Devmount --bind/proc/mnt/procMount --bind/sys/ Mnt/sys

Chroot to Debian on a removable hard drive

chroot /mnt

Re-install Grub

grub-Install /dev/sdb

Update GRUB Configuration

Grub-mkconfig-o/boot/grub/grub.cfg

Exit Chroot Environment

Exit

Uninstalling partitions and directories

umount /mnt/Devumount /mnt/procumount /mnt/sysumount /mnt

Rebuild complete

Reconnect the removable hard drive has been restored to boot smoothly into the Debian system and repaired successfully. The contents and settings of the files on the hard drive remain in the state for an instant before the transmission connection is interrupted, but fortunately it is not possible to store important data as early as expected.

It is recommended that you do not install systems that perform important work on mobile devices that are old, poorly-contacted, of a general quality, and slow to read and write data, and that the probability of damage to the data or even the disk is quite high once an accidental event occurs. In particular, the quality of the usb2.0u disk do not risk, unless it is intended to combat various repair and data recovery skills. In addition, in the environment where bear children and pets often haunt, try not to use the system on the mobile device, so as not to surprise.

Grub in a Linux environment that directly re-moves the hard drive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.