mr-manuel / raspberry-pi-backup

This script allows you to backup your Raspberry Pi to a SMB/CIFS share on a NAS/computer without removing the SD card.
MIT License
30 stars 4 forks source link

NVME Support #10

Closed iceyman closed 2 months ago

iceyman commented 2 months ago

G'day mate just wondering if you could add NVME support at all like add a section we can choose either nvme or sdcard ?

mr-manuel commented 2 months ago

But how would you restore the backup then?

Have you a Rasbperry Pi with NVMe?

You could change that line easily to match the NVMe path:

https://github.com/mr-manuel/raspberry-pi-backup/blob/3b3089299e3319f55cc16b6d9b900c5c219185ca/raspberry-pi-backup/backup.sh#L84

for example

 if [ "$(ps | grep -c 'dd if=/dev/nvme0n1')" -gt 1 ]; then
iceyman commented 2 months ago

Restore it via imager or whatever to nvme as u can boot it


From: Manuel @.> Sent: Wednesday, August 28, 2024 10:12:27 PM To: mr-manuel/raspberry-pi-backup @.> Cc: iceyman @.>; Author @.> Subject: Re: [mr-manuel/raspberry-pi-backup] NVME Support (Issue #10)

But how would you restore the backup then?

Have you a Rasbperry Pi with NVMe?

You could change that line easily to match the NVMe path:

https://github.com/mr-manuel/raspberry-pi-backup/blob/3b3089299e3319f55cc16b6d9b900c5c219185ca/raspberry-pi-backup/backup.sh#L84

for example

if [ "$(ps | grep -c 'dd if=/dev/nvme0n1')" -gt 1 ]; then

— Reply to this email directly, view it on GitHubhttps://github.com/mr-manuel/raspberry-pi-backup/issues/10#issuecomment-2315156156, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIYQXF7OQ65Y7XPUMAX34LZTW5CXAVCNFSM6AAAAABNIA3NZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGE2TMMJVGY. You are receiving this because you authored the thread.Message ID: @.***>

iceyman commented 2 months ago

G'day mate yes i have changed a few lines from

 if [ "$(ps | grep -c 'dd if=/dev/mmcblk0')" -gt 1 ]; then
        echo "Backup already running. Exiting..."
        echo
        exit
    fi
    # create backup
    echo "Using script dd for backup."
    "${SCRIPT_DIR}/ext/dd" if=/dev/mmcblk0 of="${BACKUP_PATH}/${BACKUP_NAME}_$(date +%Y%m%d_%H%M%S).img" bs=1MB status=progress

# if not use the system dd
else
    # check if backup is already running
    if [ "$(ps -aux | grep -c 'dd if=/dev/mmcblk0')" -gt 1 ]; then
        echo "Backup already running. Exiting..."

To

 if [ "$(ps | grep -c 'dd if=/dev/nvme0n1')" -gt 1 ]; then
        echo "Backup already running. Exiting..."
        echo
        exit
    fi
    # create backup
    echo "Using script dd for backup."
    "${SCRIPT_DIR}/ext/dd" if=/dev/nvme0n1 of="${BACKUP_PATH}/${BACKUP_NAME}_$(date +%Y%m%d_%H%M%S).img" bs=1MB status=progress

# if not use the system dd
else
    # check if backup is already running
    if [ "$(ps -aux | grep -c 'dd if=/dev/nvme0n1')" -gt 1 ]; then
        echo "Backup already running. Exiting..."

And works Fine :D

But how would you restore the backup then? Same as before mate you can boot a NVME and also write to an NVME is you have usb to nvme

Have you a Rasbperry Pi with NVMe? Yes i have a pi4 and a pi5 setup and i have used your script to back them up after changes

iceyman commented 2 months ago

Thanks mate :D