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

Re: change hostname & static IP & ???



On Tue 12 Apr 2016 at 17:28:14 (-0400), ken wrote:
> On 04/12/2016 03:27 AM, tomas@tuxteam.de wrote:
> >On Mon, Apr 11, 2016 at 08:31:16PM -0500, David Wright wrote:
> >>On Mon 11 Apr 2016 at 19:02:45 (-0400), ken wrote:
> >>>This is on Wheezy for a Raspberry Pi.
> >>>
> >>>Using dd, I copied the SD card for one (nicely working and
> >>>configured) system onto another SD card [...]

> It sounds like "update-initramfs -v -u all" should be the last thing
> I do before the initial reboot, yes?
> 
> 
> >Beware that now you have two different file systems with
> >the same UUID. This might confuse some all too credulous
> >programs that rely on (re-) seeing the same medium if the
> >UUID didn't change.
> 
> Very good to know... and I didn't know that at all.  A quick look
> around found me dbus-uuidgen, a command to create a new uuid.  It's
> stored in /var/lib/dbus/machine-id says the manpage... and
> confirmed.  Is that the UUID you're referring to?
> 
> The manpage makes this one seem easy...
> 
> cd [the SD card's / mount point]
> dbus-uuidgen > var/lib/dbus/machine-id

Not that one, but that's worth doing (assuming that the mount point is
not / itself). But you need to remove machine-id first or nothing
may happen.

> There are also things called UUIDs, or 'labels', for devices and for
> partitions and for swap(s).  Do I need to do something with them as
> well?

Yes, what you see when you type
$ ls -l /dev/disk/by*
Whether they matter depends if you're using them or not (though
it's bad form to have duplicates). For unencrypted filesystems,
the contents of /etc/fstab will show how you're selecting filesystems
to mount.

If you created your _partitions_ on the clone independently from the
original (ie you dd'd /dev/sdc1 for example), then the partition
UUIDs will differ. But if you dd'd the entire card (as /dev/sdc for
example), then the partition UUIDs (partuuids) will also be
duplicated.

In both cases, the filesystem UUIDs will have been duplicated; those
are the ones in /dev/disk/by-uuid/ which are used by /etc/fstab if
the latter contains lines starting with UUID=. Grub also picks
these up when it writes a new /boot/grub/grub.cfg.
The same applies to /dev/disk/by-label and LABEL= if you use those.
(Grub doesn't.)

tune2fs will let you change the UUID and LABEL on ext filesystems.
I use gdisk to create partitions, and that handles partition UUIDs
(called GUIDs) and disk GUIDs. I think that becomes important with
encrypted disks, but others may need to help you there.

Cheers,
David.


Reply to: