You are not logged in.
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
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
I think there is a bit of a language barrier here. I can't understand this:
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
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
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
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.
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.
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
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
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.
Offline
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
Possible to make /etc on a separate partition that is unique to each machine, but with the same UUID..
Offline
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
The answers depend on what exactly you are trying to do. So, once again:
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.
----
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
Sorry, apparently I don't know how to ask questions. ((
Offline
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