Portable linux installation with predefined hardware configs

If none of the more specific forums is the right place to ask

Portable linux installation with predefined hardware configs

Postby godblessfq » 2018-07-01 08:11

I have desktop computer and a laptop, I only use one at a time. What I want is a
portable hard drive with debian installed, and I can boot from it for both the
desktop and laptop. So I don't need to keep several copies of applications and
sync data between the two.

From the research I have done so far, there are two approaches:

1. use a live system with the drawback of not able to create user account, and I
doubt that the live system will have good hardware support, such as nvidia
graphics, as it is a pain even in an installed system.

2. install the system to a usb drive with the drawback of not able to
automatically detect hardwares that are different from the hardwares during
the install.

I think approach 2 is the way to go, with the following steps:

1. find out what files are changed when install linux to different hardwares
2. put those files in different folders of the installation
3. before connecting the portable usb drive to another computer, in the booted
system or connect the portable usb drive to another system, and hardlink
or symlink the hardware specific files to the correct path

It would be perfect if we could select the predefined hardware configuration at
boot time. I don't know how to do all this. Maybe somepeople have the same need like
mine. Any suggestions and directions to tools will be greatly appreciated!
godblessfq
 
Posts: 4
Joined: 2018-07-01 07:46

Re: Portable linux installation with predefined hardware con

Postby bw123 » 2018-07-01 10:45

godblessfq wrote:I have desktop computer and a laptop, I only use one at a time. What I want is a portable hard drive with debian installed, and I can boot from it for both the desktop and laptop. So I don't need to keep several copies of applications and sync data between the two.
...


Well, you would not need several copies of applications, just two. I think syncing the data could be fairly trivial, depending on how you setup.

godblessfq wrote:...
It would be perfect if we could select the predefined hardware configuration at boot time.
...


I've been interested in this idea for awhile, and read several threads about it also. I used to have a usb install, and swapped it between an intel and a radeon setup by modifying an xorg.conf before booting it. It worked, but it really wasn't as beneficial and useful as I thought it would be. And what if I did want to use both at the same time? For instance play a game on the desktop, and internet on the laptop?

I have never found a way to do it that made sense, so installing to both systems and sharing data is what I do.
User avatar
bw123
 
Posts: 3287
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Portable linux installation with predefined hardware con

Postby Head_on_a_Stick » 2018-07-01 12:12

godblessfq wrote:2. install the system to a usb drive with the drawback of not able to
automatically detect hardwares that are different from the hardwares during
the install.

Why do you think that?

The system should be transferable as long as a driver isn't forced to load that doesn't work with the hardware (such as forcing an Intel video driver if the box only has a radeon video card)— as long as both machines accept the stock Debian configuration then udev will load everything you need.

If there are any problems with initrd.img then that can be rebuilt with all modules if needed.

I used to run #! from a USB3 stick and that was freely transferable across a wide range of devices with no need for tweaking.
User avatar
Head_on_a_Stick
 
Posts: 7911
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Portable linux installation with predefined hardware con

Postby godblessfq » 2018-07-03 09:00

The system should be transferable as long as a driver isn't forced to load that doesn't work with the hardware (such as forcing an Intel video driver if the box only has a radeon video card)


I don't think it is that simple, I can't find a package that can do hardware detection and xserver setup automatically. If there is a initrd image with all available drivers, why do we need a live image that is not able to fully utilize the hardware for some machines. Anyway, one install for all won't be possible if no body is interested, and the maintainer are going to drop support for live images https://lists.debian.org/debian-live/20 ... 00064.html

The possible workaround perhaps is to have the basic system installed in both computers, and applications installed in one of the two, if I am on the other computer, I can chroot to the externally attached drive of the previous system to use the single copies of some big applications and data.
godblessfq
 
Posts: 4
Joined: 2018-07-01 07:46

Re: Portable linux installation with predefined hardware con

Postby godblessfq » 2018-07-03 09:06

I used to have a usb install, and swapped it between an intel and a radeon setup by modifying an xorg.conf before booting it. It worked, but it really wasn't as beneficial and useful as I thought it would be. And what if I did want to use both at the same time? For instance play a game on the desktop, and internet on the laptop?


I still think there is a use case for one install for multiple systems: you can just duplicate the disk image if you want to use it on two machines, that will save you the time to setup and install the system multiple times. I know you can use preseeding to save some time, but still there are many other touch-ups that need to be conducted manually.
godblessfq
 
Posts: 4
Joined: 2018-07-01 07:46

Re: Portable linux installation with predefined hardware con

Postby Head_on_a_Stick » 2018-07-03 14:49

godblessfq wrote:
The system should be transferable as long as a driver isn't forced to load that doesn't work with the hardware (such as forcing an Intel video driver if the box only has a radeon video card)


I don't think it is that simple, I can't find a package that can do hardware detection and xserver setup automatically.

The X server itself is really rather good at autoconfiguration these days, how do you suppose the live images work?

As long as you have no xorg configuration file at all then Debian will detect the card and load the appropriate video driver — my #! USB stick was regularly swapped between an Intel & a Radeon laptop with no problems.
User avatar
Head_on_a_Stick
 
Posts: 7911
Joined: 2014-06-01 17:46
Location: /dev/chair


Re: Portable linux installation with predefined hardware con

Postby stevepusser » 2018-07-03 17:15

It just works, in my somewhat limited experience. The kernel handles hardware detection and driver loading, so you don't need anything extra. Hands off any xorg.conf files unless you really know what you're doing. Lots of people have used the MX snapshot tool to do exactly what you say---making their own customized MX and then installing it on their friends' and family's machines. (MX snapshot is not compatible with standard Debian, though)

Why not something like Respin http://www.linuxrespin.org/ and see how it works?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.6, Pale Moon 28.1.0, wine-staging 3.16, qBittorrent 4.1.3, Linux kernel 4.18.8, virtualbox 5.2.18
User avatar
stevepusser
 
Posts: 9920
Joined: 2009-10-06 05:53

Re: Portable linux installation with predefined hardware con

Postby godblessfq » 2018-07-04 01:07

My system is changing every day, so making lots of snapshots is not an option. I use dotbot to sync dotfiles between computers. I think the best way of sharing systems (app and data) between machines is perhaps schroot. Thanks to everyone for the tips!
godblessfq
 
Posts: 4
Joined: 2018-07-01 07:46

Re: Portable linux installation with predefined hardware con

Postby sunrat » 2018-07-05 00:12

Try your No.2 option to see if it works. Otherwise -

debiman wrote:maybe what op wants is live usb with persistence?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2433
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Portable linux installation with predefined hardware con

Postby CwF » 2018-07-05 20:30

It works fine without any work. If you'd like to you can specify all known net interfaces by mac so that is configured with what it finds. Xorg needs to be left alone but in a similar way known hardware can have conditions if found, and audio may need help to figure out. Or if your comfy editing a file cli to clarify, then a startx... I install to a vm, image to an ssd, and it works on every computer I have.Take a disk from a machine, image or mount it and it works in a vm. No issue really. Once you start adding extra stuff like vfio's, clock pinning and weird things you add errors in the logs, but it still works..

On edit I'll add, usb works too, I've imaged to a stick but prefer to use my usb2sata dongle since I often use an old 32G SSD for testing a computer. My main computer has a dock for the ssd, easier I think.
CwF
 
Posts: 102
Joined: 2018-06-20 15:16


Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable