You are not logged in.

#1 2014-07-12 14:54:11

Giacomo Ritucci
Member
From: Bologna, Italy
Registered: 2009-10-25
Posts: 26

[SOLVED] grub can't read ($root)/boot/ directory

I rsync'd my existing Arch Linux installation to my external usb drive (single partition with ext4 fs).

When I boot from the USB drive, grub can't find the normal.mod file and drops me into a rescue shell.

Inspecting with ls from the grub rescue shell I found that grub can successfully list contents of some directories but not others.

Example:

ls ($root)/usr/

correctly lists /usr/ contents, but

ls ($root)/boot/

gives no output at all (no ./ ../ either). Same thing with ls ($root)/home/

I can see /mnt/passport-nero/boot and /mnt/passport-nero/home contents booting my existing Arch and mounting my external usb drive.

Why grub can't see boot directory but can see usr from the same partition/filesystem?

This is what I did:

  1. fdisk /dev/sdb to repartition the external usb

  2. mkfs.ext4 /dev/sdb1 to format the partition

  3. sudo mount /dev/sdb1 /mnt/passport-nero

  4. sudo rsync -aAXHSv /* /mnt/passport-nero --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

  5. update fstab

  6. sudo arch-chroot /mnt/passport-nero /bin/bash

  7. mkinitcpio -p linux

  8. grub-install --target=i386-pc --recheck --debug /dev/sdb

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

  10. exit from chroot, umount, reboot -> grub rescue

Any idea?

Last edited by Giacomo Ritucci (2014-07-13 08:34:17)


One of these days I'm gonna learn to play and write myself a song

Offline

#2 2014-07-12 16:53:43

Giacomo Ritucci
Member
From: Bologna, Italy
Registered: 2009-10-25
Posts: 26

Re: [SOLVED] grub can't read ($root)/boot/ directory

grub shell from my existing arch linux installation behaves the same.

I'm going to download another live distro to see if different versions of grub show the same behaviour.


One of these days I'm gonna learn to play and write myself a song

Offline

#3 2014-07-12 17:15:39

Giacomo Ritucci
Member
From: Bologna, Italy
Registered: 2009-10-25
Posts: 26

Re: [SOLVED] grub can't read ($root)/boot/ directory

Tried something stupid and it worked:

cp -a /mnt/passport-nero/{boot,lol}
rm -r /mnt/passport-nero/boot
mv /mnt/passport-nero/{lol,boot}

Now I'm writing from my external usb disk install.

I'm a bit puzzled, a run of fsck.ext4 didn't detect anything.

What kind of diagnostic I can run on the filesystem to ensure that everything is ok?


One of these days I'm gonna learn to play and write myself a song

Offline

#4 2014-07-13 08:33:27

Giacomo Ritucci
Member
From: Bologna, Italy
Registered: 2009-10-25
Posts: 26

Re: [SOLVED] grub can't read ($root)/boot/ directory

fsck finds no problems, I'm gonna tag this thead solved.

sudo fsck.ext4 -pvcf /dev/sdb1 
/dev/sdb1: Updating bad block inode.

      210456 inodes used (0.34%, out of 61046784)
        1537 non-contiguous files (0.7%)
         156 non-contiguous directories (0.1%)
             # of inodes with ind/dind/tind blocks: 0/0/0
             Extent depth histogram: 201280/63
     5716241 blocks used (2.34%, out of 244182016)
           0 bad blocks
           1 large file

      185913 regular files
       15287 directories
           0 character device files
           0 block device files
           0 fifos
        1648 links
        9247 symbolic links (9105 fast symbolic links)
           0 sockets
------------
      212095 files

One of these days I'm gonna learn to play and write myself a song

Offline

Board footer

Powered by FluxBB