Welcome!
Important information
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.1 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

PC-specific inits

Help for Current Versions of MX
Post Reply
User avatar
thomasl
Forum Regular
Forum Regular
Posts: 159
Joined: Sun Feb 04, 2018 10:26 am

PC-specific inits

#1

Post by thomasl » Sat Aug 11, 2018 5:51 am

I am currently dual-booting MX17.1 with Windows 7 on two PCs. The MX install is frugal w/ root persistence and "shared" between the two PCs (effectively meaning that I simply copy the rootfs from the MX boot directory from one to the other if there are material changes or install a new snapshot on both). This works reasonably well, not least because most data files are on a NAS and accessed via network shares.

However, there are some things which have to be done differently on those PCs, for instance both machines share the same hostname and domain name, as it is. I know how to change (most of) these things via a shell script but I am not so sure as to a safe and stable way to identify the PCs in the first place. One option might be the sda UUID, another the MAC address and there are certainly others. One could even combine more than one of those ID values. So what's the best way to uniquely identify a PC booted from a live system?
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
I used to think that good grammar is important. Now I know that good wine is importanter.

User avatar
fehlix
Forum Veteran
Forum Veteran
Posts: 3153
Joined: Wed Apr 11, 2018 5:09 pm

Re: PC-specific inits

#2

Post by fehlix » Sat Aug 11, 2018 7:19 am

thomasl wrote:
Sat Aug 11, 2018 5:51 am
I am currently dual-booting MX17.1 with Windows 7 on two PCs. The MX install is frugal w/ root persistence and "shared" between the two PCs (effectively meaning that I simply copy the rootfs from the MX boot directory from one to the other if there are material changes or install a new snapshot on both). This works reasonably well, not least because most data files are on a NAS and accessed via network shares.

However, there are some things which have to be done differently on those PCs, for instance both machines share the same hostname and domain name, as it is. I know how to change (most of) these things via a shell script but I am not so sure as to a safe and stable way to identify the PCs in the first place. One option might be the sda UUID, another the MAC address and there are certainly others. One could even combine more than one of those ID values. So what's the best way to uniquely identify a PC booted from a live system?
The hd-uuid's are only relevant within "one" system, the are not conflicting over any net connections.
The hostname should be adjusted via a boot option of the Live/FrugalBoot, e.g.

Code: Select all

hostname=myhost1
as two identical hostnames connected with the LAN might cause issues.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
thomasl
Forum Regular
Forum Regular
Posts: 159
Joined: Sun Feb 04, 2018 10:26 am

Re: PC-specific inits

#3

Post by thomasl » Sat Aug 11, 2018 8:48 am

fehlix wrote:
Sat Aug 11, 2018 7:19 am
The hd-uuid's are only relevant within "one" system, the are not conflicting over any net connections.
That was my thinking... so this and/or MAC addresses might be good candidate.
fehlix wrote:
Sat Aug 11, 2018 7:19 am
The hostname should be adjusted via a boot option of the Live/FrugalBoot, e.g.

Code: Select all

hostname=myhost1
as two identical hostnames connected with the LAN might cause issues.
That potential for conflict is actually one of the main reasons why I started looking into this.

And this boot option is perhaps the best, or simplest, way forward. Instead of trying to identify the PCs via some unique ID and then set hostname and other things accordingly, I do it in reverse: I set the hostname option to ThisHostOrThatHost in the grub-legacy boot menus on the two PCs and then I can look into /etc/hostname* and find out on which PC the system has been booted.

* EDIT: or simply check $HOSTNAME (bash) or $HOST (zsh)...
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
I used to think that good grammar is important. Now I know that good wine is importanter.

Post Reply

Return to “MX Help”