glacion / genfstab Goto Github PK
View Code? Open in Web Editor NEWStandalone version of genfstab tool found in Arch Linux
License: GNU General Public License v3.0
Standalone version of genfstab tool found in Arch Linux
License: GNU General Public License v3.0
DDBI
is also a variable like LABEL, PARTLABEL
see man fstab described.
DDBI
(or another short you like) mean /dev/disk/by-id/
or better said WWN
World-Wide-Number, this regard not only SCSI & SATA-HDD's but also SATA-SSD, M.2-NVMe and even USB-Sticks.
During PARTLABEL, UUID,,,
are asked through command blkid
the WWN
is asked through ls -la /dev/disk/by-id/
.
ls -la /dev/disk/by-id/ | grep nvme- | awk 'NR==1 {print $9}' # M.2-NVMe
ls -la /dev/disk/by-id/ | grep wwn- | awk 'NR==1 {print $9}' # SATA-HDD
ls -la /dev/disk/by-id/ | grep ata- | awk 'NR==1 {print $9}' # SATA-SSD
ls -la /dev/disk/by-id/ | grep usb- | awk 'NR==1 {print $9}' # USB-Sticks
Here you find IEEE Extended Unique Identifier (EUI64) specification of NVMe 1.3 (page 217) an here IEEE Extended Unique Identifier (EUI64) of NVMe 2.0a page 139.
The lines in /etc/fstab
coulds just look like:
/dev/disk/by-id/nvme-........
/dev/disk/by-id/wwn-.........
/dev/disk/by-id/ata-...........
/dev/disk/by-id/usb-...........
or to make it perfect:
DDBI=nvme-
DDBI=wwn-
DDBI=ata-
DDBI=usb-
an alternative could be, the user set a a disk-variable e.g.:
DISK=/dev/disk/by-id/nvme-...............
to mount it as already possible:
mount $DISK /mnt
and then, after the other steps, genfstab
accept the variable, e.g.:
genfstab /mnt/$DISK >> /mnt/etc/fstab
What do you mean about?
genfstab no longer puts uuid for /boot. Only put /dev/sdX1 for uuid. I ran genfstab on a similar setup before and there were no issues. Not sure what I changed but what could cause this and how would I even troubleshoot it?
shellcheck genfstab
Line 51:
out() { printf "$1 $2\n" "${@:3}"; }
^-- SC2059: Don't use variables in the printf format string. Use printf '..%s..' "$foo".
Line 72:
local i= chr= out=
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
Line 90:
local i= chr= out= len=$(( ${#1} - 4 ))
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
Line 164:
local options_=$1
^-- SC2178: Variable was used as an array but is now assigned a string.
Line 194:
read dm_name <"/sys/class/block/${1#/dev/}/dm/name"
^-- SC2162: read without -r will mangle backslashes.
Line 215:
local src=$1 spec= label= uuid= comment=()
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
^-- SC1007: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
Line 243:
[[ $comment ]] && printf '# %s\n' "${comment[*]}"
^-- SC2128: Expanding an array without an index only gives the first element.
Line 276:
if optstring_get_option "$varname" codepage && [[ $codepage = cp* ]]; then
^-- SC2154: codepage is referenced but not assigned.
Line 417:
read
^-- SC2162: read without -r will mangle backslashes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.