Giter VIP home page Giter VIP logo

genfstab's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

genfstab's Issues

Could you add variable `-D` (shortcut for `-t DDBI`)?

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/.

  • Here the commands to detect all "WWN"'s:
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?

doesn't populate uuid for /boot, only puts /dev/sdX1

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?

Fix shellcheck errors and warnings

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.