[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ODROID XU4 and UEFI - Re: Cautionary tale: how to kill an SDCard with one simple command



On 26/07/18 16:15, Gene Heskett wrote:
On Thursday 26 July 2018 03:06:31 Mark Morgan Lloyd wrote:

On 25/07/18 21:30, Gene Heskett wrote:
On Wednesday 25 July 2018 16:15:03 Mark Morgan Lloyd wrote:
There are still ways of working round that sort of problem. For
example, you can copy an entire device using dd to capture boot
segments and partition layout, inspect and recreate the filesystems
using mkfs, then use [something] to copy files one at a time into
the new filesystems taking care that some bootloaders need a wakeup
call when a file moves.

As far as "something" is concerned:

dd: Sector-by-sector copy between devices and files.
tar: Good ol' archiver, with directory-exclude etc. options.
netpipes: Do a tar or dd over the LAN.
rsync: File-by-file copy over LAN.
rdist: Ditto, less well-known but with some good points.

I'll have to look at that. I need dd like copies, but I don't
want /media/slash to be anything but an empty dir in the image it
makes.

dd to a file, then use  losetup -f -P  to make the partitions in that
file mountable, mount the appropriate one and delete the stuff you
don't want.

Wouldn't the file, if put on /media/slash, it seems dd would
include /media/slash in that file, and the result even if it didn't get
into a recursion forever loop, would still be around 10GB bigger than
media//slash, and it already has some stuff  on it:

I was assuming that you weren't trying to dd to something on the same physical device... which would be highly inadvisable if not impossible since you need to put what you're copying from into a quiescent state (i.e. single user or as Adam pointed out fsfreeze.

So either get another temporary device and connect it via USB, or use dd+netpipes to copy the device onto a different system over the LAN.

I need dd like to preserve the file addresses in /boot as I've read they
are expected to be at fixed addresses with this boot method.

There's usually something that can't easily be moved, unless there's a loader in ROM with enough smarts to be able to drive a FAT (etc.) filesystem.

Maybe it would be best if I used the resize utility to resize the / to
just over whats used. I've made a copy of /home/pi/linuxcnc, so I at
least have the codes I've already written backed up locally.

But you'll still need to unmount / or at the very least go into single-user mode or freeze it before you can do anything like that.

And I've not been able to find, but haven't looked online, a man page for
rdist. Now have, but bears a re-read, its nothing like a dd.

As I said above, rdist is comparable with rsync.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


Reply to: