• ZFS Help wanted - managed to destroy my /boot/efi partiton


    yes, well this is rather emberassing. during my misson to reformat a fisty usb disk i managed to reformat /dev/sda1 instead. that is the efi partition created by cnchi at install.

    any way i can rebuild it?

    [[email protected] antergos]# mount /dev/sda1 /mnt/boot/efi
    mount: wrong fs type, bad option, bad superblock on /dev/sda1,
           missing codepage or helper program, or other error
    
           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    [[email protected] antergos]# fdisk -l /dev/sda1
    Disk /dev/sda1: 200 MiB, 209715200 bytes, 409600 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    [[email protected] antergos]# fdisk /dev/sda1
    
    Welcome to fdisk (util-linux 2.29.2).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table.
    Created a new DOS disklabel with disk identifier 0x4c25e12e.
    
    Command (m for help): p
    Disk /dev/sda1: 200 MiB, 209715200 bytes, 409600 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: dos
    Disk identifier: 0x4c25e12e
    
    Command (m for help): q
    
    [[email protected] antergos]# 
    
    
  • show me:

    sudo fdisk -l
    

    and try to remember what exactly you do on try to format the usb stick.

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • I did a quick format from ‘disk’ gui util by accident, it was for some reason higlithed instead of my usb disk

    fdisk-l on the affacted partiton is included with the opening post.

    [[email protected] antergos]# fdisk -l
    Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: 707A10A1-E36C-8C4D-BAE7-7915BDFA05C3
    
    Device          Start        End    Sectors   Size Type
    /dev/sdb1        2048 1953507327 1953505280 931.5G Solaris /usr & Apple ZFS
    /dev/sdb9  1953507328 1953523711      16384     8M Solaris reserved 1
    
    
    Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: 91C5FACF-C9C1-456A-A2AD-2339C5732832
    
    Device       Start        End    Sectors   Size Type
    /dev/sda1     2048     411647     409600   200M EFI System
    /dev/sda2   411648    1460223    1048576   512M Linux filesystem
    /dev/sda3  1460224 1953525134 1952064911 930.8G Solaris root
    
    
    Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: C2598B70-68F6-E34C-A476-331BA66F84D9
    
    Device          Start        End    Sectors   Size Type
    /dev/sdc1        2048 1953507327 1953505280 931.5G Solaris /usr & Apple ZFS
    /dev/sdc9  1953507328 1953523711      16384     8M Solaris reserved 1
    
    
    Disk /dev/sdd: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: BB5A5CB5-0DB5-F04D-95F1-AB5C976ED8F5
    
    Device          Start        End    Sectors   Size Type
    /dev/sdd1        2048 1953507327 1953505280 931.5G Solaris /usr & Apple ZFS
    /dev/sdd9  1953507328 1953523711      16384     8M Solaris reserved 1
    
    
    Disk /dev/sde: 111.8 GiB, 120034123776 bytes, 234441648 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
    Disk identifier: 213A22DF-9F4F-FC4B-8BA7-24585CF8CA4E
    
    Device         Start       End   Sectors   Size Type
    /dev/sde1       2048 234424319 234422272 111.8G Solaris /usr & Apple ZFS
    /dev/sde9  234424320 234440703     16384     8M Solaris reserved 1
    
    
    Disk /dev/sdf: 111.8 GiB, 120034123776 bytes, 234441648 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
    Disk identifier: 57B6D77E-0064-8C42-9F93-B7FFA7F20774
    
    Device         Start       End   Sectors   Size Type
    /dev/sdf1       2048 234424319 234422272 111.8G Solaris /usr & Apple ZFS
    /dev/sdf9  234424320 234440703     16384     8M Solaris reserved 1
    
    
    Disk /dev/sdg: 111.8 GiB, 120034123776 bytes, 234441648 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
    Disk identifier: 308D7733-BA58-8E44-BA95-2FF479A2438B
    
    Device         Start       End   Sectors   Size Type
    /dev/sdg1       2048 234424319 234422272 111.8G Solaris /usr & Apple ZFS
    /dev/sdg9  234424320 234440703     16384     8M Solaris reserved 1
    
    
    Disk /dev/sdh: 111.8 GiB, 120034123776 bytes, 234441648 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
    Disk identifier: 5D266BCC-EFF0-D746-B3DC-77B7DBBF5BD3
    
    Device         Start       End   Sectors   Size Type
    /dev/sdh1       2048 234424319 234422272 111.8G Solaris /usr & Apple ZFS
    /dev/sdh9  234424320 234440703     16384     8M Solaris reserved 1
    
    
    
    
    Disk /dev/sdm: 15 GiB, 16039018496 bytes, 31326208 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
    Disk identifier: 0x2a5a02b8
    
    Device     Boot Start     End Sectors  Size Id Type
    /dev/sdm1  *        0 3623039 3623040  1.7G  0 Empty
    /dev/sdm2         224  131295  131072   64M ef EFI (FAT-12/16/32)
    
    
    Disk /dev/loop0: 1.6 GiB, 1739403264 bytes, 3397272 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
    
    
    Disk /dev/zd0: 5 GiB, 5368709120 bytes, 10485760 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 8192 bytes
    I/O size (minimum/optimal): 8192 bytes / 8192 bytes
    [[email protected] antergos]# 
    
    

    I need to rebuild the /dev/sda1 partiton as it now is empty.

  • What a setup :pencil: ;)
    looks like a MAC server to me…

    Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Device Start End Sectors Size Type
    /dev/sda1 2048 411647 409600 200M EFI System >> EFI/fat - boot partition
    /dev/sda2 411648 1460223 1048576 512M Linux filesystem >>> /boot >> for GRUB
    /dev/sda3 1460224 1953525134 1952064911 930.8G Solaris root >> your / <{root} filesystem

    So if your EFI partition on /dev/sda1 is reformatted,
    /dev/sda2 = /boot
    /dev/sda3 = /
    you need to rebuild grub installation as follows:

    sudo su
    mount /dev/sda3 /mnt
    mount dev/sda2 /mnt/boot
    mount /dev/sda1 /mnt/boot/efi
    arch-chroot /mnt
    
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Antergos-grub
    

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • as it is a zfs setup i need to do zpool import -a -R /mnt -----> to mount /
    then mount /dev/sda2 /mnt/boot ----> OK
    mount /dev/sda1 /mnt/boot/efi ---->

    mount: wrong fs type, bad option, bad superblock on /dev/sda1,
           missing codepage or helper program, or other error
    
           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    
    

    So i first need to correctly rebuild the partitin as it for formated by CNCHI at install time, I am unsure on how to do that.

  • EFI partition needs to be FAT32 ;)

  • ah… yes lol i knew that. need more coffe i think :P

    # mkfs.msdos -F 32 /dev/sda1
    mkfs.fat 4.1 (2017-01-24)
    
  • [[email protected] /]# grub-mkconfig -o /boot/grub/grub.cfg
    Generating grub configuration file ...
    Found theme: /boot/grub/themes/Antergos-Default/theme.txt
    Found linux image: /boot/vmlinuz-linux
    Found initrd image: /boot/initramfs-linux.img
    Found fallback initramfs image: /boot/initramfs-linux-fallback.img
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
    ERROR: mkdir /var/lock/dmraid
      WARNING: Failed to connect to lvmetad. Falling back to device scanning.
    grub-probe: error: cannot find a GRUB drive for /dev/sdm1.  Check your device.map.
    done
    
    
    [[email protected] /]# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Antergos-grub
    Installing for x86_64-efi platform.
    grub-install: error: efibootmgr: not found.
    [[email protected] /]# 
    
  • sudo pacman -S efibootmgr

managed1 wanted4 destroy1 zfs34 Posts 9Views 600
Log in to reply