You are not logged in.

#1 2021-02-27 17:16:20

Terence64w
Member
Registered: 2020-12-17
Posts: 18

/dev/disk/by-id/ as default

Hello,

reading some wikis like arch-UDEV and others , apparently, the best way to set variables and permanent disks name is UDEV.

Now, during installation and before partitioning and formatting I can read the '/disk/by-id/' with:

ls -la /dev/disk/by-id/

and set the variable:

DISK=/dev/disk/by-id/nvme-eui.(here the 16-digits)

that I can use with 'gdisk', 'mkfs', 'tune2fs -L' etc.. e.g.:

gdisk $DISK
 > or
mkfs.ext4 $DISK-part3

My question:
Is a way to make it permanently? And howto?

Offline

#2 2021-02-27 17:25:07

Maniaxx
Member
From: .de
Registered: 2014-05-14
Posts: 411

Re: /dev/disk/by-id/ as default

What do you mean by 'make it permanently'? For Bash? Then 'export' that variable to the global environment.
https://wiki.archlinux.org/index.php/en … s#Globally


sys2064

Offline

#3 2021-03-05 11:17:59

Terence64w
Member
Registered: 2020-12-17
Posts: 18

Re: /dev/disk/by-id/ as default

Maniaxx wrote:

What do you mean by 'make it permanently'? For Bash? Then 'export' that variable to the global environment.
https://wiki.archlinux.org/index.php/en … s#Globally

I read this part of the wiki too but...
1. Where to put?:

/etc/environment
/etc/profile
/etc/bash.bashrc
~/.bash_profile
~/.bashrc
/etc/zsh/zshenv
/etc/zsh/zprofile
/etc/zsh/zshrc
~/.zshrc

2.  When are reading the file?:

/etc/environment
/etc/profile
/etc/bash.bashrc
~/.bash_profile
~/.bashrc
/etc/zsh/zshenv
/etc/zsh/zprofile
/etc/zsh/zshrc
~/.zshrc

3. Best name for this Variable?
4. Exact syntax for this Variable?
5. Best syntax for Sub-Variable e.g. $DISK-part1

can someone help me?

Offline

#4 2021-03-05 13:31:47

Maniaxx
Member
From: .de
Registered: 2014-05-14
Posts: 411

Re: /dev/disk/by-id/ as default

I put my personal variables into ~/.bashrc.


sys2064

Offline

#5 2021-03-05 14:54:19

seth
Member
Registered: 2012-09-03
Posts: 19,814

Re: /dev/disk/by-id/ as default

Where to export variables is determined by where you want them to be exported, ie. where and when which user needs to be able to access them.
There's no cookie-cutter answer here.

The syntax is explained in the linked wiki and you can ensure their access by eg. "${DISK}-part1" which will reliably read the value of $DISK and append "-part1" instead of trying to resolve a variable named "DISK-part1".

Offline

#6 2021-03-06 00:53:57

Terence64w
Member
Registered: 2020-12-17
Posts: 18

Re: /dev/disk/by-id/ as default

seth wrote:

Where to export variables is determined by where you want them to be exported, ie. where and when which user needs to be able to access them.
There's no cookie-cutter answer here.

The syntax is explained in the linked wiki and you can ensure their access by eg. "${DISK}-part1" which will reliably read the value of $DISK and append "-part1" instead of trying to resolve a variable named "DISK-part1".

The point the Variable should be available/readable/usable is at earlier time as possible for everybody/globally.

Thanks for your tip/explanation "${DISK}-part1". Will I be able to put this variable in e.g. `/etc/fstab`? E.G. `${DISK1}-part1` #for EFI-partition, `${DISK1}-part2` #for root and `${DISK1}-part3 #for swap? Or it's useful only for additional "Data-Disks"? or at all?

By the way, when starting USB for installation and assign ones `DISK=/dev/disk/by-id/nvme-eui.<+16 digits>` I don't need `${DISK}-part1` but just `$DISK-part1`, the reason for this you will see by using Code:

ls -la /dev/disk/by-id/

and the question is... do I need `${DISK}-part1`? or just `$DISK-part1`?

If I knew before the proper syntax and in which conf-file should be inserted, than i had no need to start a thread. Can you make me an example?

Sorry, but I respond already that I didn't understood what inside wiki's, can you explain me like to small child?

1. Which conf-file is read at first and available to the whole system?
2. Have I to set the "variable" to more than one conf-files? and which? e.g. for root and user?
3. Can i safely use the variable `DISK` e.g. `DISK1` or I will encounter difficulties because of already existing such or similar variable? One unique, maybe not used, variable name could be DCDOS (Data Carrier Device Operating System) or have you a very short else unused variable-name?

Note: I boot over rEFInd where using already `root=/dev/disk/by-id/nvme-eui.<+16 digits>` as well `/etc/fstab` use it too.

Thanks in advance for you patience.

Offline

#7 2021-03-06 07:18:21

seth
Member
Registered: 2012-09-03
Posts: 19,814

Re: /dev/disk/by-id/ as default

Will I be able to put this variable in e.g. `/etc/fstab`

No? What are you actually trying to do?
By which I mean: what problem do you try to solve? Not "how do I solve my problem with what I believe to be the solution of my actual problem".
https://en.wikipedia.org/wiki/XY_problem

can you explain me like to small child?

No. Ask your parents.

Offline

#8 2021-04-07 11:23:41

Terence64w
Member
Registered: 2020-12-17
Posts: 18

Re: /dev/disk/by-id/ as default

seth wrote:
Will I be able to put this variable in e.g. `/etc/fstab`

No? What are you actually trying to do?
By which I mean: what problem do you try to solve? Not "how do I solve my problem with what I believe to be the solution of my actual problem".
https://en.wikipedia.org/wiki/XY_problem

can you explain me like to small child?

No. Ask your parents.

Can you tell me for which people is written the Wiki or is the division between 'bbs' and not bbs? and what does mean (e.g.) in the ZFS-Wiki 'that is just strait away'? Here also a lot of links saying almost nothing.

What does mean in the HiDPI-Wiki "there are tricks to force Gtk-application use HiDPI'?

Is not more simple to say 'I don't know'? you don't know the answer! Or is a secret?

It's very simple to know where is an appropriate link to post by each uncomfortable question than knowing the answer.

By the way, my parents are all dead since long time and you have not the right to become personal or intimate whit me.

I pity you but here the facts:

- ZFS is very old as well the WWN but most secure, the wwn can be detected also with:

lsblk -d -p -n -l -o NAME,SIZE,WWN -e 7,11

(this is a code founded in 'archfi' but without WWN i found in the manpage of lsblk)
- An '/usr/share/haskell/register/haskell-uuid-types.sh' is present, an for wwn not.
- Making an own iso with ZFS is a question of luck or... first must be installed arch-lts to get working 'archiso' and 'zfs' and then reinstall the final sytem.
- Due zfs-discordance with arch-kernel-version should be installed anyway LTS

This all is not explained in the ZFS or any other wiki. Also is not explained how to configure and use swap-partition (linux-swap, bsd-swap), even is not explained if ZFS is extended to EFI-partition or swap.

There are more question than answer and we stuck already by 'wwn' or 'eui'

The result is, even if i'm capable to install archlinux on zfs (with or without any help/support), arch will use UUID and zfs will use EUI/WWN and this is bad not only for me because the whole system will become weak.

This and all points above show that zfs is not integrated at all because we fail already by supposedly easiest part.

Last edited by Terence64w (2021-04-07 11:27:38)

Offline

#9 2021-04-07 11:39:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,528

Re: /dev/disk/by-id/ as default

This is the first time in this thread you are talking about wanting to use ZFS for anything... And yes ZFS is not integrated at all which is why there's a distinct wiki page containing information of how to use it if you want to, what exactly is unclear about it? If I'm reading this right you won't have any of the ZFS volumes directly referenced in fstab as the accompanying service files should set this up once configured.

It's still not clear what your actual goal or question is. What do you want to have at the end of this install? You asked about whether it's possible to define variables in /etc/fstab and the answer to that is no it isn't. What's your end goal here? The only thing here that is answerable that I can see is the question about swap and the ESP. You probably can't expand ZFS over the EFI system partition as that must be fat in most forms that are relevant. AS for the swap partition this is explained in: https://wiki.archlinux.org/index.php/ZFS#Swap_volume (or, just make a distinct partition for swap that's also outside of the ZFS scope)

Last edited by V1del (2021-04-07 12:13:01)

Offline

#10 2021-04-07 13:04:27

seth
Member
Registered: 2012-09-03
Posts: 19,814

Re: /dev/disk/by-id/ as default

Tracing this thread he wants to use the WWN for fstab, apparently out of an unexplained and unreasoned belief that "ZFS is very old as well the WWN but most secure" and "arch will use UUID and zfs will use EUI/WWN and this is bad not only for me because the whole system will become weak".
Since fstab doesn't allow to reference the disk by-id, he figured he's going to export the WWN from udev and hoped to use a bash variable in fstab - though we were actually just starting with variables for gdisk and mkfs…

@Terence64w: sorry for your parents, but your questions are not "uncomfortable" but gibberish at best, poking around the actual task at hand.
And asking to be talked to "like to small child" is just ridiculous. You tell small children to stay away from the buttons.

So for the n-th time in this thread:
Describe the problem you seek to solve, nobody is going to be able to give you a helpful answer otherwise because nobody has even a remote chance to know what you actually want to achieve (and why, but answering "why" is going to be part of the explanation of your actual problem you think to have)

Edit: this could be as trivial as you can actually use /dev/disk/by-id/wwn-somethingsomethingsomething as device to be mounted in fstab (instead of eg. /dev/sda)
Though I hope that the situation is more complicated than this…
Edit2: make sure to not do that for random other IDs, they're usually neither unique nor constant.

Last edited by seth (2021-04-07 13:16:11)

Offline

Board footer

Powered by FluxBB