rpi-clone to img file #6

Open
opened 2014-06-20 19:54:08 +02:00 by dmezzogori · 8 comments
dmezzogori commented 2014-06-20 19:54:08 +02:00 (Migrated from github.com)

Is it possible to use rip-clone to write not to an sd-card but to a img file (perhaps created with dd)? If so, how to?

Is it possible to use rip-clone to write not to an sd-card but to a img file (perhaps created with dd)? If so, how to?
ozett commented 2015-05-13 07:33:46 +02:00 (Migrated from github.com)

hi. also a feature-request:
maybe you change your scprit to rsync backups over the net/lan to a central rasperry-backupserver?
i find your script juseful. thanx a lot..

hi. also a feature-request: maybe you change your scprit to rsync backups over the net/lan to a central rasperry-backupserver? i find your script juseful. thanx a lot..
hominhquan commented 2015-07-26 20:39:14 +02:00 (Migrated from github.com)

For exporting to img, dd can do the stuff :

(sudo) dd if=<your_sd_disk> of=/path/to/your/img bs=1M
For exporting to img, dd can do the stuff : ``` (sudo) dd if=<your_sd_disk> of=/path/to/your/img bs=1M ```
llimz commented 2017-03-10 10:51:36 +01:00 (Migrated from github.com)

+1 for this feature request.

+1 for this feature request.
gamade commented 2017-08-25 08:17:14 +02:00 (Migrated from github.com)

+1

I worked on a litte script and I used loopback devices.
It would be very nice, because you can deal with image files with all advantages... and if you need a "real" clone you dd the file to a sd-card.

+1 I worked on a litte script and I used loopback devices. It would be very nice, because you can deal with image files with all advantages... and if you need a "real" clone you dd the file to a sd-card.
jtmoderate876 commented 2017-12-12 04:13:44 +01:00 (Migrated from github.com)

+1 for ability to write to an image file while ignoring open/temp files and also truncating to a small file.

+1 for ability to write to an image file while ignoring open/temp files and also truncating to a small file.
DiscoFever78 commented 2021-02-04 06:14:41 +01:00 (Migrated from github.com)

+1 for image file support.

+1 for image file support.
rfv-370 commented 2021-09-16 17:47:54 +02:00 (Migrated from github.com)

+1 for image file support!

+1 for image file support!
saaibo commented 2023-07-27 12:34:32 +02:00 (Migrated from github.com)

Is it possible to use rip-clone to write not to an sd-card but to a img file (perhaps created with dd)? If so, how to?

Hi all,

I believe this could be possible with small changes to rpi-clone, but I do not have enough knowledge, I'd probably mung it.

What I've done so far:

  • Mounted a SMB share on /media.
  • Created a zero filled file, /media/rpibup.img, a tad larger than the sum of the boot partition and main partition's used space.
  • Loop mounted the above file, with -Pf params.
  • Launched rpi-clone: sudo rpi-clone loop0 --exclude=/media/*.

Here's the output:

 Initializing
  Imaging past partition 1 start.
  => dd if=/dev/mmcblk0 of=/dev/loop0 bs=1M count=8 ...
  Resizing destination disk last partition ...
    Resize success.
  Changing destination Disk ID ...Re-reading the partition table failed.: Invalid argument

  => mkfs -t vfat -F 32  /dev/loop01 ...
  => mkfs -t ext4  /dev/loop02 ...

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/loop02 on /mnt/clone
mount: special device /dev/loop02 does not exist
    Mount failure of /dev/loop02 on /mnt/clone.
Aborting!

Script's trying to operate on partitions /dev/loop0[12], while loopback calls them this way (a "p" between device's name and partition no.):

Device       Boot  Start      End  Sectors  Size Id Type
/dev/loop0p1        8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/loop0p2      532480 25199999 24667520 11.8G 83 Linux

I can guess two solutions: having loopback not to insert that letter, or make rpi-clone loopback aware. Is any viable?

TIA, cheers!

> Is it possible to use rip-clone to write not to an sd-card but to a img file (perhaps created with dd)? If so, how to? Hi all, I believe this could be possible with small changes to rpi-clone, but I do not have enough knowledge, I'd probably mung it. What I've done so far: - Mounted a SMB share on `/media`. - Created a zero filled file, `/media/rpibup.img`, a tad larger than the sum of the boot partition and main partition's used space. - Loop mounted the above file, with `-Pf` params. - Launched rpi-clone: `sudo rpi-clone loop0 --exclude=/media/*`. Here's the output: ``` Initializing Imaging past partition 1 start. => dd if=/dev/mmcblk0 of=/dev/loop0 bs=1M count=8 ... Resizing destination disk last partition ... Resize success. Changing destination Disk ID ...Re-reading the partition table failed.: Invalid argument => mkfs -t vfat -F 32 /dev/loop01 ... => mkfs -t ext4 /dev/loop02 ... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/loop02 on /mnt/clone mount: special device /dev/loop02 does not exist Mount failure of /dev/loop02 on /mnt/clone. Aborting! ``` Script's trying to operate on partitions `/dev/loop0[12]`, while loopback calls them this way (a "p" between device's name and partition no.): ``` Device Boot Start End Sectors Size Id Type /dev/loop0p1 8192 532479 524288 256M c W95 FAT32 (LBA) /dev/loop0p2 532480 25199999 24667520 11.8G 83 Linux ``` I can guess two solutions: having loopback not to insert that letter, or make rpi-clone loopback aware. Is any viable? TIA, cheers!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lerking/rpi-clone#6
No description provided.