1

When installing Elementary OS, I've chosen too small a size for /boot and it constantly bites me when doing updates.

The rest of the drive is a single LUKS encrypted root partition:

lsblk --fs
NAME            FSTYPE      LABEL  UUID                                   FSAVAIL FSUSE% MOUNTPOINT
...
nvme0n1                                                                                  
├─nvme0n1p1     vfat               F37A-4778                               224.3M    15% /boot/efi
├─nvme0n1p2     ext4               f68b8c29-141b-4bec-8812-c5203be4f684     41.7M    83% /boot
└─nvme0n1p3     crypto_LUKS        715ee16e-ba60-487a-8944-23b3b561b2bb                  
  └─cryptdata   LVM2_member        UFo5le-jPA4-5k4d-fpV3-7eGx-fTGR-6mU5Bo                
    ├─data-root ext4               cd4a0015-3306-4c64-988c-83235baca874    581.3G    31% /
    └─data-swap swap               65e49edd-8a15-4d30-b966-4df0bcdce12f                  [SWAP]

I can't simply shrink the encrypted partition to get back the space for my /boot so I wanted to make a backup using fsarchiver, reinstall and then reapply the backup. I think it is the only way to fit the data back into a smaller partition.

I've found this answer: https://unix.stackexchange.com/a/101925 but I am not sure how to use it. AFAIU, I don't have to perform the first step because I want to archive the partition I am currently using nvme0n1p3 which is already opened. So I've cd'ed into an external drive and tried:

sudo fsarchiver savefs `date +%Y_%m_%d`_root.fsa /dev/nvme0n1p3 -v -j11

but I got:

filesys.c#140,devcmp(): Warning: [/dev/fuse] is not a block device
oper_save.c#1037,filesystem_mount_partition(): cannot mount partition [/dev/nvme0n1p3]: filesystem may not be supported by either fsarchiver or the kernel.
removed 2022_04_23_root.fsa

Should I open the partition with cryptsetup somehow? Is it because I didn't use LiveCD?

tkowal
  • 123
  • 4

2 Answers2

1

Should I open the partition with cryptsetup somehow?

From your lsblk output you seem to already have it open.

You cannot save /dev/nvme0n1p3 directly as it is a LUKS encrypted partition, not a file system. As you are using LVM, the file system resides at /dev/cryptdata/data-root.

chwallen
  • 301
  • 2
  • 4
1

From the man page of fsarchiver:

fsarchiver [ options ] savefs archive device ...

savefs Save device filesystem to archive.

So the device parameter is expected to be a reference to a filesystem. Your parameter /dev/nvme0n1p3 is a device, but it doesn't contain a filesystem. This is why you got the error message:

oper_save.c#1037,filesystem_mount_partition(): cannot mount partition [/dev/nvme0n1p3]: filesystem may not be supported by either fsarchiver or the kernel.

/dev/nvme0n1p3 contains LUKS encrypted data, which (when decrypted) contains LVM data. Your actual ext4 filesystem is in the logical volume data-root, which is listed in your lsblk output. fsarchiver should be able to access the filesystem through this logical volume. So the correct device parameter for fsarchiver would be probably /dev/mapper/data-root.

I don't know if this works in a running system. Creating a backup of a complete filesystem, that is something i prefer to do on a non-mounted or readonly-mounted filesystem (using a LiveCD and cryptsetup).

Sheldon
  • 200
  • 6