Other mount_msdosfs: /dev/adaXp1: Invalid argument

Hello,

I'm trying to replace a failing disk on FreeBSD 13.2-STABLE with zpool mirror. Here is what I have before connecting a new hard drive:
Code:
# gpart show
=>        40  3907029088  ada0  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528   134217728     3  freebsd-swap  (64G)
   134752256  3772276736     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)

=>        40  3907029088  ada1  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528   134217728     3  freebsd-swap  (64G)
   134752256  3772276736     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)
Once I connect the new hard drive, it is the new drive which becomes /dev/ada0 and I get this error:
Code:
Mounting local file systems: mount_msdosfs: /dev/ada0p1: Invalid argument
I tried gpart backup and gpart restore, which worked in previous versions of FreeBSD, but not this time.
I also tried
Code:
dd if=/dev/ada1p1 of=/dev/ada0p1 bs=4M
but got the same error again.

How do I go about replacing the failing drive? Is it documented in the handbook?
 
Thank you both!

Code:
# newfs_msdos -F32 /dev/ada0p1
newfs_msdos: 16630 clusters too few clusters for FAT32, need 65525

However, the option -F16 worked and the system booted normally into multiuser mode with the new drive connected.
Then rebooted to single user mode and mounted ada0p1:
Code:
# mount -t msdosfs -o rw /dev/ada0p1 /mnt

But, how do I mount /dev/ada1p1 and where?
Code:
# umount /mnt
# mount -t msdosfs -o ro /dev/ada1p1 /mnt
mount_msdosfs: /dev/ada1p1: Invalid argument
 
Claimed to be efi:
Code:
# gpart show ada1
=>        40  3907029088  ada1  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528   134217728     3  freebsd-swap  (64G)
   134752256  3772276736     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)
 
I tried gpart backup and gpart restore, which worked in previous versions of FreeBSD, but not this time.
This only copies the partition table, not the content of those partitions.

The efi partition is a FAT formatted file system. To recreate it, simply format it, then copy /boot/loader.efi to $EFI_PART/EFI/Boot/Bootx64.efi. This is the 'default' file a UEFI boot will try to load. You can also use $EFI_PART/EFI/FreeBSD/loader.efi, but check with efibootmgr(8) if it's configured to load this.

Some time ago there was a bug in the installer, if you installed a mirrored system it would only correctly set up the efi partition on the first disk, the efi partition on the second disk would be left untouched and remain empty.
 
SirDice, thank you. Here is what I have now:
Code:
# gpart show
=>        40  3907029088  ada1  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528   134217728     3  freebsd-swap  (64G)
   134752256  3772276736     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)

=>        40  3907029088  ada2  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528   134217728     3  freebsd-swap  (64G)
   134752256  3772276736     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)

=>        40  3907029088  ada0  GPT  (1.8T)
          40      532480     1  efi  (260M)
      532520  3906496608        - free -  (1.8T)
The failing drive is ada1 (WD2003FZEX) and the new one is of course ada0.
Code:
# efibootmgr --dry-run
Boot to FW : false
BootCurrent: 0000
Timeout    : 1 seconds
BootOrder  : 0000, 0004, 0008, 0009, 0003, 0007
+Boot0000* FreeBSD
 Boot0004* WDC WD2003FZEX-00Z4SA0
 Boot0008* WDC WD2003FYYS-02W0B1
 Boot0009* ST2000DM008-2FR102
 Boot0003  ATAPI   iHAS120   6
 Boot0007  UEFI OS
Should I now copy /boot/loader.efi to /boot/efi/EFI/Boot/Bootx64.efi? Is this the correct capitalization, or should it all be lower case?
Currently, on my computer the directory /boot/efi is empty.
 
… Is this the correct capitalization, or should it all be lower case? …

Lowercase is fine. Here, for example:

Code:
% ls -hln /boot/efi/EFI/Boot/
total 1
-rwxr-xr-x  1 0 0  645K 19 Sep  2022 bootx64.efi
%

Also, the EXAMPLES section of loader.efi(8) will help.
 
Back
Top