#3311 Issue closed
: Any thoughts why we can't use find_device
here?¶
Labels: cleanup
gdha opened issue at 2024-09-05 15:13:¶
Any thoughts why we can't use `find_device` here?
It seems to me like our code simply doesn't handle the nvme use case
yet, it assumes a sysfs device path like
/devices/pci0000:00/0000:00:10.0/host2/target2:0:1/2:0:1:0/block/sdb/sdb1
whereas in your example we have
devices/pci0000:c0/0000:c0:03.3/0000:c5:00.0/nvme/nvme0/nvme0n1
@xwhitebeltx have you tried creating a partition and specifying that instead of the whole disk?
Originally posted by @schlomo in https://github.com/rear/rear/issues/3178#issuecomment-2004477308
gdha commented at 2024-09-05 15:21:¶
@schlomo To use the find_disk
function in script
lib/layout-functions.sh
there is a problem in function
get_parent_components
on line done < $LAYOUT_DEPS
The $LAYOUT_DEPS is empty.
When we add in the function
LAYOUT_DEPS="$VAR_DIR/layout/diskdeps.conf"
then it works better.
However, that being said it is better not to use find_disk
function as
it searches the diskdeps.conf file for the parent device. And, in this
case (nvme0n1) it will not find it as it is skipped as an empty device
(by savelayout).
The reason why LAYOUT_DEPS variable is empty in above case (with
treating nvme0n1 as an USB device) is because the initialization of
these variables is only done in the savelayout workflow.
We need to find a better why.
Therefore, I propose to remove the comments in rear/usr/share/rear/format/USB/default/200_check_usb_layout.sh as it is misleading info.
gdha commented at 2024-09-06 09:32:¶
Was able to get it to work - still need to test it with legacy USB devices.
#-> rear -v -d -D format -- --efi /dev/nvme7n1
Relax-and-Recover 2.6 / 2020-06-17
Running rear format (PID 2853731)
Using log file: /var/log/rear/rear-AWSABLIRLL000K.log
Running workflow format on the normal/original system
USB device /dev/nvme7n1 is not formatted with ext2/3/4 or btrfs filesystem
UserInput -I USB_DEVICE_CONFIRM_FORMAT needed in /usr/share/rear/format/USB/default/200_check_usb_layout.sh line 68
Type exactly 'Yes' to format /dev/nvme7n1 with ext3 filesystem
(default 'No' timeout 300 seconds)
Yes
UserInput: No choices - result is 'Yes'
Repartitioning '/dev/nvme7n1'
The --efi toggle was used with format - making an EFI bootable device '/dev/nvme7n1'
Creating GUID partition table (GPT) on '/dev/nvme7n1'
Creating EFI system partition with size 1024 MiB aligned at 8 MiB on '/dev/nvme7n1'
Creating ReaR data partition up to 100% of '/dev/nvme7n1'
Setting 'boot' flag on /dev/nvme7n1
Creating vfat filesystem on EFI system partition on '/dev/nvme7n1p1'
Creating ext3 filesystem with label 'REAR-000' on '/dev/nvme7n1p2'
Adjusting filesystem parameters on '/dev/nvme7n1p2'
Exiting rear format (PID 2853731) and its descendant processes ...
Running exit tasks
gdha commented at 2024-09-10 11:50:¶
With PR #3312 merged we can close this issue. The comment has been removed.
[Export of Github issue for rear/rear.]