Welcome! Log In Create A New Profile

Advanced

Move rootfs to different machine? (pogoplug v4)

Posted by bohannin 
Move rootfs to different machine? (pogoplug v4)
February 04, 2016 10:06AM
I have a few PogoPlugs - 1 E02 and 2 v4's. I have debian running successfully on the E02 and 1 v4 using Bodhi's rootfs, and kernel updated to 4.4. I'd like to copy the root fs to another drive to get the 2nd v4 up and running, but I've run into some problems. I tarred the rootfs on a diff linux box and set up an identical drive to the first and untarred the rootfs to the sda1 partition. Unfortunately, the 2nd v4 wont boot with that cloned rootfs (with updated hostname).

To test the 2nd v4 out, I installed a fresh copy of the rootfs, and that booted successfully. Then I took the original usb drive (configured rootfs) from the 1st v4 and tried to boot the 2nd and it did not boot either. It seems they will only boot with the rootfs that was set up from scratch on them for some reason? Is there any config in the rootfs I need to blank out / update to get a configured rootfs to boot on different but identical hardware? Thanks!
Re: Move rootfs to different machine? (pogoplug v4)
February 04, 2016 01:57PM
When you use an existing rootfs to boot another identical box (or another Kirkwood box in this case), you will need to make sure the udev rules for persistent-net are removed or modified. This usually causes network problem because of conflicting MAC address.

To make it really simple, remove these 2 files (or rename them to *.save so that they will be regenerated by udev using the new MAC address) before mounting to the other box:

/etc/udev/rules.d/70-persistent-net.rules
/lib/udev/rules.d/75-persistent-net-generator.rules

Note that the number 70 and 75 are varied on different systems, but they are not important in this respect.

To reuse the rootfs for many boxes, it is best to modify them (instead of removing). If you want to do that, pls post back for instruction.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 02/04/2016 02:00PM by bodhi.
Re: Move rootfs to different machine? (pogoplug v4)
February 04, 2016 04:22PM
Thanks for the quick reply, Bodhi. I'll give it a shot, but I'm sure that's the issue. What's the reason for removing both the generator and the rule? I see the MAC in the rules file (in hindsight, I should have grepped for this), but not in the generator.
Re: Move rootfs to different machine? (pogoplug v4)
September 15, 2016 02:07AM
I would like to learn to modify the rules files.
Re: Move rootfs to different machine? (pogoplug v4)
September 15, 2016 02:35AM
Modify these 2 files (the bold lines below).

/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# Unknown net device (/devices/platform/mv643xx_eth_port.0/net/eth0) (mv643xx_eth_port)
# Unknown net device (/devices/platform/mv643xx_eth_port.0/net/eth0) (mv643xx_eth_port)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="4c:9e:ff:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

/lib/udev/rules.d/75-persistent-net-generator.rules
# These rules generate rules to keep network interface names unchanged
# across reboots and write them to /etc/udev/rules.d/70-persistent-net.rules.

# variables used to communicate:
#   MATCHADDR		MAC address used for the match
#   MATCHID		bus_id used for the match
#   MATCHDRV		driver name used for the match
#   MATCHIFTYPE		interface type match
#   COMMENT		comment to add to the generated rule
#   INTERFACE_NAME	requested name supplied by external tool
#   INTERFACE_NEW	new interface name returned by rule writer

ACTION!="add",				GOTO="persistent_net_generator_end"
SUBSYSTEM!="net",			GOTO="persistent_net_generator_end"

# ignore the interface if a name has already been set
NAME=="?*",				GOTO="persistent_net_generator_end"

# new predictable network interface naming scheme
# http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
IMPORT{cmdline}="net.ifnames"
ENV{net.ifnames}=="1",			GOTO="persistent_net_generator_end"

# device name whitelist
KERNEL!="Eth*|ath*|Wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
					GOTO="persistent_net_generator_end"

This will prevent udev to generate new rules for persistent network eth0 and eth1. The old rules that contains the MAC address of the old box was basically the problem. udev tries to generate a new rule for eth1, which is non-esxistent.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Move rootfs to different machine? (pogoplug v4)
September 15, 2016 02:36AM
Thanks guys for reminding me to include this topic in the wiki thread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: