Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when backing up EFI partition #150

Open
caslubas opened this issue Apr 22, 2024 · 5 comments
Open

Error when backing up EFI partition #150

caslubas opened this issue Apr 22, 2024 · 5 comments

Comments

@caslubas
Copy link

Hello everybody!

I am using fsarquiver, version 0.8.7 (2023-03-19), to generate a copy of a card that has a raspberry system installed.

Running from a debian bookworm.

Using the following command line:

sudo fsarchiver -v -j4 -A savefs /home/carlos.lubas/crt-gw-lora-eng-v4-bkp.fsa /dev/sdc

This line results in the following error:

filesys.c#318,generic_mount(): partition [/dev/sdc] cannot be mounted on [/tmp/fsa/20240422-133850-0000edf6-00] as [vfat] with options []
oper_save.c#1049,filesystem_mount_partition(): cannot mount partition [/dev/sdc]: filesystem may not be supported by either fsarchiver or the kernel.

What is the way to correct it?

@vorwd
Copy link

vorwd commented Apr 27, 2024

Can you provide the output of:
fsarchiver probe simple

@caslubas
Copy link
Author

Can you provide the output of:
fsarchiver probe simple <

Sorry, at the moment, I don't have the device at hand, as soon as I do, I'll post the command output.

@caslubas
Copy link
Author

@vorwd
Here is the output:

sudo fsarchiver probe simple
[======DISK======] [=============NAME==============] [====SIZE====] [MAJ] [MIN]
[sda             ] [WDC WD10EZEX-08W               ] [   931.51 GB] [  8] [  0]
[sdb             ] [KINGSTON SA400S3               ] [   447.13 GB] [  8] [ 16]
**[sdc             ] [Card  Reader                   ] [     7.40 GB] [  8] [ 32]**
[nvme0n1         ] [PM951 NVMe SAMSUNG 256GB                ] [   238.47 GB] [259] [  0]

[=====DEVICE=====] [==FILESYS==] [======LABEL======] [====SIZE====] [MAJ] [MIN] 
[sda2            ] [ntfs       ] [Arquivos         ] [   931.28 GB] [  8] [  2] 
[sdb1            ] [vfat       ] [<unknown>        ] [   100.00 MB] [  8] [ 17] 
[sdb2            ] [<unknown>  ] [<unknown>        ] [    16.00 MB] [  8] [ 18] 
[sdb3            ] [ntfs       ] [<unknown>        ] [   446.21 GB] [  8] [ 19] 
[sdb4            ] [ntfs       ] [<unknown>        ] [   820.00 MB] [  8] [ 20] 
**[sdc1            ] [vfat       ] [boot             ] [    64.00 MB] [  8] [ 33] 
[sdc2            ] [squashfs   ] [<unknown>        ] [     4.00 GB] [  8] [ 34]** 
[nvme0n1p1       ] [vfat       ] [<unknown>        ] [   953.00 MB] [259] [  1] 
[nvme0n1p2       ] [btrfs      ] [<unknown>        ] [   237.54 GB] [259] [  2] 

I need to backup the SD card (/dev/sdc)

@vorwd
Copy link

vorwd commented Apr 29, 2024

Thanks, @caslubas

I hope the below helps you out.

So, the FS in fsarchiver means "File System" (e.g. a partition/file system of a physical disk/drive) -- this means that you can't just issue a command for the entire drive/card, /dev/sdc, to create like a "clone" or exact copy of the drive/card.

You can still achieve this though --

save two filesystems (/dev/sdc1 and /dev/sdc2) to an archive:

fsarchiver -v -j4 -A savefs /data/myarchive2.fsa /dev/sdc1 /dev/sdc2

Then, when you need to restore it, you'll issue a command to restore both the vfat and the squashfs onto another card/device.

restore two filesystems (/dev/sdc1 and /dev/sdc2) to a card/drive:`

fsarchiver -v restfs /data/myarchive2.fsa id=0,dest=/dev/sdc1 id=1,dest=/dev/sdc2

The "id" number refers to the file system within the backup/archive, and "dest" refers to where you want that "id" to end up. Typically speaking, this correlates to the order in which you added the file system during your backup command.

If you are unsure what a particular file systems ID might be, you can always run fsarchiver archinfo and reference to "Filesystem id in archive":

fsarchiver archinfo /data/myarchive2.fsa

Sample fsarchiver archinfo output
fsarchiver archinfo /mnt/usb/myclone.fsa
====================== archive information ======================
Archive type: filesystems
Filesystems count: 2
Archive id: 2a110D6F
Archive file format: FsArCh_002
Archive created with: 0.7.6
Archive creation date: 20100131-07:16:35
Archive label: myclone
Compression level: 7 (lzma level 1)
Encryption algorithm: none

===================== filesystem information ====================
Filesystem id in archive: 0
Filesystem format: vfat
Filesystem label: efi
Filesystem uuid: d76278bf-5e65-4568-a899
Original device: /dev/sda1
Original filesystem size: 512.18 MB
Space used in filesystem: 500.86 MB

===================== filesystem information ====================
Filesystem id in archive: 1
Filesystem format: ext4
Filesystem label: debian
Filesystem uuid: 4b0da78f-7f02-4487-a1e2
Original device: /dev/sda2
Original filesystem size: 111.81 GB
Space used in filesystem: 8.11 GB

@vorwd
Copy link

vorwd commented Apr 29, 2024

I do have an overly "wordy" walkthrough of a use-case of mine where I used fsarchiver -- it has a lot of details regarding fsarchiver commands, options and syntax -- feel free to give it a read if you're bored on the toilet one day.

Use case was "clone" a larger drive and restore it to a smaller drive -- 120GB SSD (only using ~8.5GB of it) and restore it onto a smaller eMMC drive of 64GB. 2x partitions; 1 vFat for efi and 1 ext4 for xUbuntu install.

Wordy Walkthrough of fsarchiver use-case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants