You are not logged in.

#1 2017-12-10 12:16:48

kale-ru
Member
Registered: 2015-07-23
Posts: 8

How to specify different schemes booting linux?

Please tell me the solution of the following question. On a portable HDD installed linux (e.g. arch). Booting with efi. There are also several computers with different partition table. For automatic mount purpose, each computer must have its own fstab. How to define different versions of fstab in /etc directory and specify them when you load linux? In General, the question is: how to specify different schemes booting linux (e.g. via the kernel options)?

Offline

#2 2017-12-10 12:28:22

TheSpiritof69
Member
Registered: 2015-03-14
Posts: 7

Re: How to specify different schemes booting linux?

https://wiki.archlinux.org/index.php/pe … y-partuuid

Assuming your portable disk is using GPT this should use the same UUIDs on all machines you plug the drive into.

Last edited by TheSpiritof69 (2017-12-10 12:28:51)

Offline

#3 2017-12-10 12:34:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: How to specify different schemes booting linux?

I think there is a bit of a language barrier here.  I can't understand this:

kale-ru wrote:

There are also several computers with different partition table.

There is not a partition table on each of the computers you plug your HDD into.  There is one partition table on the HDD.

If you are concerned about that HDD being sometimes recognized as /dev/sda and sometimes /dev/sdb because of other devices or disks in other computers, then the link about UUIDs above is the solution.  UUIDs should just be used anyways.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2017-12-10 12:41:16

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

TheSpiritof69 wrote:

https://wiki.archlinux.org/index.php/pe … y-partuuid

Assuming your portable disk is using GPT this should use the same UUIDs on all machines you plug the drive into.

This is an interesting option, but then fstab should be completely similar.But often on different machines need different fstab.Frankly, more interested in the answer to a more General question: how to implement a different loading scheme? For example, the scheme of service needs to be different.

Offline

#5 2017-12-10 12:46:11

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

Trilby wrote:

I think there is a bit of a language barrier here.  I can't understand this:

kale-ru wrote:

There are also several computers with different partition table.

There is not a partition table on each of the computers you plug your HDD into.  There is one partition table on the HDD.

If you are concerned about that HDD being sometimes recognized as /dev/sda and sometimes /dev/sdb because of other devices or disks in other computers, then the link about UUIDs above is the solution.  UUIDs should just be used anyways.

Sorry, my English is not so good as I would like. )) Computers also have a desktop hdd with its partitions that must be present in fstab.

Offline

#6 2017-12-10 12:48:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: How to specify different schemes booting linux?

kale-ru wrote:

But often on different machines need different fstab.

No, that's the point.  If done correctly, the fstab should not change at all on different machines.

kale-ru wrote:

Frankly, more interested in the answer to a more General question: how to implement a different loading scheme? For example, the scheme of service needs to be different.

Can you give examples of what you are looking for?  If you want several options in a boot menu to determine whether you get a graphical desktop, a tty-only, or various combinations of services, then use different boot targets.

kale-ru wrote:

Computers also have a desktop hdd with its partitions that must be present in fstab.

Why would the local partitions need to be in fstab?  If you just want to mount non-system drives, there are other approaches other than fstab.  How many different computers will this portable HDD be used in?  If there are only a few, you can use fstab and list the UUID of every partition that would ever be mounted, and use `nofail` or similar in the boot options for the non-essential ones.  But if you want this to be a general-purpose portable system that can mount any other devices, fstab is the wrong approach: udev/udisks2 will be much better.

So please describe your end goal.  How will this portable HDD be used?  How many computers will you plug it in to (small number of machines known before-hand like moving between an work and home computer, or an undefined large number of machines).  Why do you need different sets of services running?

Last edited by Trilby (2017-12-10 12:52:35)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2017-12-10 12:59:07

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

Trilby wrote:
kale-ru wrote:

But often on different machines need different fstab.

No, that's the point.  If done correctly, the fstab should not change at all on different machines.

kale-ru wrote:

Frankly, more interested in the answer to a more General question: how to implement a different loading scheme? For example, the scheme of service needs to be different.

Can you give examples of what you are looking for?  If you want several options in a boot menu to determine whether you get a graphical desktop, a tty-only, or various combinations of services, then use different boot targets.

kale-ru wrote:

Computers also have a desktop hdd with its partitions that must be present in fstab.

Why would the local partitions need to be in fstab?  If you just want to mount non-system drives, there are other approaches other than fstab.  How many different computers will this portable HDD be used in?  If there are only a few, you can use fstab and list the UUID of every partition that would ever be mounted, and use `nofail` or similar in the boot options for the non-essential ones.  But if you want this to be a general-purpose portable system that can mount any other devices, fstab is the wrong approach: udev/udisks2 will be much better.

So please describe your end goal.  How will this portable HDD be used?  How many computers will you plug it in to (small number of machines known before-hand like moving between an work and home computer, or an undefined large number of machines).  Why do you need different sets of services running?

I also decided I needed to try to identify different target for systemd. But how to specify to the kernel (systemd), user-defined target?

Offline

#8 2017-12-10 13:02:05

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: How to specify different schemes booting linux?

kale-ru wrote:

But how to specify to the kernel (systemd), user-defined target?

If you'd read the link that Trilby posted then you'd know how to do this.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2017-12-10 13:04:22

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

Probably I incorrectly asked a question. fstab is used as an example, one of various configuration files in /etc/. Machines can be completely different, including different configuration files in /etc. But linux is on a portable hdd. How to use a different /etc for different machines?

Last edited by kale-ru (2017-12-10 13:05:44)

Offline

#10 2017-12-10 13:09:18

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

Possible to make /etc on a separate partition that is unique to each machine, but with the same UUID..

Offline

#11 2017-12-10 13:16:39

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

slithery wrote:
kale-ru wrote:

But how to specify to the kernel (systemd), user-defined target?

If you'd read the link that Trilby posted then you'd know how to do this.

You probably know the answer to the question: how to specify to the kernel (systemd), user-defined target?

Offline

#12 2017-12-10 13:18:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: How to specify different schemes booting linux?

The answers depend on what exactly you are trying to do.  So, once again:

Trilby wrote:

So please describe your end goal.  How will this portable HDD be used?  How many computers will you plug it in to (small number of machines known before-hand like moving between an work and home computer, or an undefined large number of machines).  Why do you need different sets of services running?

More specifically now, will each of these machines be set up to store their own /etc/, or must you have many versions of /etc/ on the same portable HDD?  And (again) about how many versions?  The only thing we can answer based on the nearly-nonexistant information you've provided is that you can't have multiple partitions with the same UUID.
----

kale-ru wrote:

You probably know the answer to the question: how to specify to the kernel (systemd), user-defined target?

Serious, read the damn link.  I give up!  For the benefit of anyone else who stumbles upon this thread, though, I'll encourage you to read this and this carefully and consider your style of posting before you alienate anyone who might be willing to help.

Last edited by Trilby (2017-12-10 13:20:48)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2017-12-10 13:20:44

kale-ru
Member
Registered: 2015-07-23
Posts: 8

Re: How to specify different schemes booting linux?

Sorry, apparently I don't know how to ask questions. ((

Offline

#14 2017-12-10 13:21:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: How to specify different schemes booting linux?

No, the problem is you don't know how to answer them.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB