Πέμπτη, 25 Απριλίου, 2024
More
    ΑρχικήLinuxRepair XFS Filesystem error

    Repair XFS Filesystem error

    xfs_repair /dev/md0
    fsck /dev/md1
    
    
    
    
    
    Check the file system and the re-install the bootloader
    Request the rescue-system and then a hardware-reset. Connect to the rescue system.
    
    Possible to mount the RAID?
    
    # mount /dev/md1 /mnt
    
    Yes. Do a file system check (first umount the file system):
    
    # ummount /mnt
    # fsck /dev/md1;
    
    Shows some (many) errors. Fixed them by staying on the "y" key. Could use the auto repair option of fsck (-y).
    Re-Install the bootloader
    This is a Hetzner installimage-setup, so there should be a grub bootloader. Check for the /boot/grub/ folder. Again mount the RAID.
    
    # mount /dev/md1 /mnt
    # ls /mnt/boot/grub
    
    It is there, so there is a good chance, that the bootloader is grub, not lilo. Now re-install grub on the disk. Actually on both disks, just in case one is missing.
    
    Make a chroot environment:
    
    # mount /dev/md1 /mnt
    # mount -t none -o bind /dev /mnt/dev
    # mount -t proc -o bind /proc /mnt/proc
    # mount -t sysfs -o bind /sys /mnt/sys
    # chroot /mnt
    
    Grub:
    
    # grub
    
    Look for the file stage1 to find the boot partitions
    
    grub> find /grub/stage1
     (hd0,1)
     (hd1,1)
    
    Install the bootloader on both partitions. Both are regarded as hd0 from the point of view of the bootloader at boot time.
    
    grub> device (hd0) /dev/sda
     device (hd0) /dev/sda
    grub> root (hd0,1)
     root (hd0,1)
      Filesystem type is ext2fs, partition type 0xfd
    grub> setup (hd0)
     setup (hd0)
      Checking if "/boot/grub/stage1" exists... yes
      Checking if "/boot/grub/stage2" exists... yes
      Checking if "/boot/grub/e2fs_stage1_5" exists... yes
      Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
     succeeded
      Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,1)...
     succeeded
     Done.
    
    The same for the other disk
    
    grub> device (hd0) /dev/sdb
    grub> root (hd1,1)
    grub> setup (hd0)
    grub> quit
    
    And reboot - works.
    Προηγούμενο άρθρο
    Επόμενο άρθρο
    Θεόδωρος Τασσόπουλος
    Θεόδωρος Τασσόπουλοςhttps://www.digispot.gr
    Τεχνολόγος Ηλεκτρονικός Μηχανικός MSc in Networking & Data Communications. MSc in Banking, Accounting and Finance. Ασχολούμαι με τον προγραμματισμό από τις αρχές του 2000. Τα τελευταία πέντε έτη ασχολούμαι με την Διοικητική Πληροφόρηση και το Business Intelligence γενικότερα. Ξεκινάω συνεχώς νέα project χωρίς να υπάρχει απαραίτητα η προοπτική του κέρδους. Λάτρης των θετικών επιστημών και θαυμαστής αυτών που τις αντιλαμβάνονται.
    RELATED ARTICLES

    Logs Filter

    Free Space σε Boot δίσκο

    Ngnix Mobile Cache

    Passive Ports Pure FTPd