1

I am working on an embedded Linux ip-camera. I need to have a backup of our Linux for testing and repairing cameras. I have tested multiple options like using tar and rsync , but it does not work and shows some errors eg.

short read and ...

The problem with dd is I dont know what part of /dev must be copied because fdisk -l shows nothing, and so there is not enough storage in cameras to save the backup file, and more about clonezilla is that I can’t install any beside package on cameras. I don't have SSH access and finally I have just telnet and serial port access. What I can do to backup and clone the Linux?

0

I assume the other device is the same ip-camera model, with an identically sized HDD/memory component. Then you could use dd to make an image of the whole HDD. Since stuff in dev, proc, sys and other such directories is not on the drive but in virtual memory, you don't need to explicitly copy it, it will be populated at boot. With something like:
cat /dev/sda|gzip /mount/backup.gz you could dump your entire drive to a mounted drive. Have a look at Disk cloning for more information.

An alternative approach would be to only backup relevant data, since it is an embedded system I suspect that there are relatively view packages installed. If this is true and you know where all the relevant data is, e.g. /etc/ , /root/, ... , you can use rsync (or duplicity) on those files only. This will be much faster, but you would first need to find all relevant files, /dev is not ammong them. You can see what directories are really on the drive if you run the mount, or the df command, everything with a tmpfs filesystem or the like doesn't need to be backed up.

  • tnx dude but assume that i want to install this linux on multiple devices with almost the same hardware what i can to do in this case ? – Mamo Ghandi Jul 24 '16 at 7:58
  • sir for using dd, if i save it as a image file does it could be dangerous??? – Mamo Ghandi Jul 24 '16 at 8:03
  • depends, do you want to install it on 50 devices, or just a couple ? If more than a couple devices and they support PXE than I would package the whole thing into a distribution and install it like that. Otherwise I would go with the second approach I showed above, make a duplicity config to clone only the relevant data, install linux the same way you did before and then pull the data with duplicity (or rsync, or ...). – rtur Jul 24 '16 at 8:04
  • dangerous in what way ? You could overwrite stuff if you aren't careful, but there is no non-deterministic element to it. Just cloning the drive with cat and piping it to either a file or via telnet only reads, so you can't mess up anything with that. – rtur Jul 24 '16 at 8:06
  • both of them first of all i want to have a backup for repairing then i want to modify it and install on more than 50 devices. dangerous in rewriting the disk – Mamo Ghandi Jul 24 '16 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.