Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

-1 votes
0 answers
53 views
How can I fix clash's parse config error: incorrect UUID length 4 in string "uuid"?
I have just installed clash from my Linux distribution's repository, and both my Linux distribution and clash are outdated (which, I am not sure, is the cause of the following problem): $ clash -v Clash 1.16.0 linux amd64 with go1.20.8 unknown time I got the following config error when running clash...
I have just installed clash from my Linux distribution's repository, and both my Linux distribution and clash are outdated (which, I am not sure, is the cause of the following problem): $ clash -v Clash 1.16.0 linux amd64 with go1.20.8 unknown time I got the following config error when running clash $ clash FATA Parse config error: proxy 3: uuid: incorrect UUID length 4 in string "uuid" I have made ~/.config/clash/config.yaml (whose content is copied and pasted at the end of this post) to be the same as the one in https://doreamon-design.github.io/clash/configuration/configuration-reference.html , except the following part for section proxy-providers (see https://doreamon-design.github.io/clash/configuration/outbound.html for detailed information): proxy-providers: provider1: type: http url: "https://node.freev2raynode.com/uploads/2025/08/1-20250807.yaml " interval: 3600 path: ./provider1.yaml health-check: enable: true interval: 600 # lazy: true url: http://www.gstatic.com/generate_204 test: type: file path: /test.yaml health-check: enable: true interval: 36000 url: http://www.gstatic.com/generate_204 Is the uuid error in ~/.config/clash/config.yaml or https://node.freev2raynode.com/uploads/2025/08/1-20250807.yaml ? How can I fix it? In config.yaml, uuid appears in > uuid: uuid as in # vmess # cipher support auto/aes-128-gcm/chacha20-poly1305/none - name: "vmess" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto If there's a problem there, what's it and how is it fixed? Thanks! **************************** In https://node.freev2raynode.com/uploads/2025/08/1-20250807.yaml , uuid has appeared in the following part: proxies: - {name: HK香港(mibei77.com 米贝节点分享), server: free-relay.themars.top, port: 37906, type: vmess, uuid: 90030631-4027-4810-8ce9-3e9095390f2d, alterId: 0, cipher: auto, tls: false, skip-cert-verify: true, network: ws, ws-path: /cctv1.m3u8, ws-headers: {Host: www.cctv.com}, udp: true} - {name: US美国(mibei77.com 米贝节点分享), server: 45.67.215.95, port: 443, type: trojan, password: tg-fq521free, skip-cert-verify: true, udp: true} - {name: US美国(mibei77.com 米贝节点分享) 2, server: dDdDdDdddDDDDyUUUIO.4444926.XyZ, port: 80, type: vmess, uuid: dc50eb1d-244d-4711-b168-a101a5e6fb1b, alterId: 0, cipher: auto, tls: false, skip-cert-verify: true, network: ws, ws-path: /awmqq79B17rfnpXiNaWb, ws-headers: {Host: dddddddddddddyuuuio.4444926.xyz}, udp: true} - {name: US美国(mibei77.com 米贝节点分享) 3, server: switcher-nick-croquet.freesocks.work, port: 443, type: ss, cipher: chacha20-ietf-poly1305, password: 9tqhMdIrTkgQ46PvhyAtMH, udp: true} - {name: US美国(mibei77.com 米贝节点分享) 4, server: 172.67.214.21, port: 443, type: trojan, password: 7248e825-887c-48b9-83bc-c26bc6392bf8, skip-cert-verify: true, udp: true} - {name: HK香港(mibei77.com 米贝节点分享) 2, server: v29.heduian.link, port: 30829, type: vmess, uuid: cbb3f877-d1fb-344c-87a9-d153bffd5484, alterId: 2, cipher: auto, tls: false, skip-cert-verify: true, network: ws, ws-path: /oooo, ws-headers: {Host: ocbc.com}, udp: true} - {name: JP日本(mibei77.com 米贝节点分享), server: arxfw2b78fi2q9hzylhn.freesocks.work, port: 443, type: ss, cipher: chacha20-ietf-poly1305, password: Nk9asglDzHzjktVzTkvhaA, udp: true} - {name: US美国(mibei77.com 米贝节点分享) 5, server: rrrrrrrrrt.11890604.xyz, port: 443, type: vmess, uuid: f898ffcb-6417-4373-9640-0b66091e8206, alterId: 0, cipher: auto, tls: true, skip-cert-verify: true, network: ws, ws-path: /GnJ3bBxV91uFkYtuzXyJ5XNeH1R1, ws-headers: {Host: rrrrrrrrrt.11890604.xyz}, udp: true} - {name: US美国(mibei77.com 米贝节点分享) 6, server: 141.11.203.26, port: 8880, type: vmess, uuid: 1fcb582e-7ffb-3708-8a0f-96c2a070e40d, alterId: 0, cipher: auto, tls: false, skip-cert-verify: true, network: ws, ws-path: "/dabai&Telegram🇨🇳@WangCai2/?ed=2560", ws-headers: {Host: TG.WangCai2.s2.cn-db.top}, udp: true} ******************************** ~/.config/clash/config.yaml: # Port of HTTP(S) proxy server on the local end port: 7890 # Port of SOCKS5 proxy server on the local end socks-port: 7891 # Transparent proxy server port for Linux and macOS (Redirect TCP and TProxy UDP) # redir-port: 7892 # Transparent proxy server port for Linux (TProxy TCP and TProxy UDP) # tproxy-port: 7893 # HTTP(S) and SOCKS4(A)/SOCKS5 server on the same port # mixed-port: 7890 # authentication of local SOCKS5/HTTP(S) server # authentication: # - "user1:pass1" # - "user2:pass2" # Set to true to allow connections to the local-end server from # other LAN IP addresses # allow-lan: false # This is only applicable when allow-lan is true # '*': bind all IP addresses # 192.168.122.11: bind a single IPv4 address # "[aaaa::a8aa:ff:fe09:57d8]": bind a single IPv6 address # bind-address: '*' # Clash router working mode # rule: rule-based packet routing # global: all packets will be forwarded to a single endpoint # direct: directly forward the packets to the Internet mode: rule # Clash by default prints logs to STDOUT # info / warning / error / debug / silent # log-level: info # When set to false, resolver won't translate hostnames to IPv6 addresses # ipv6: false # RESTful web API listening address external-controller: 127.0.0.1:9090 # A relative path to the configuration directory or an absolute path to a # directory in which you put some static web resource. Clash core will then # serve it at http://{{external-controller}}/ui . # external-ui: folder # Secret for the RESTful API (optional) # Authenticate by spedifying HTTP header Authorization: Bearer ${secret} # ALWAYS set a secret if RESTful API is listening on 0.0.0.0 # secret: "" # Outbound interface name # interface-name: en0 # fwmark on Linux only # routing-mark: 6666 # Static hosts for DNS server and connection establishment (like /etc/hosts) # # Wildcard hostnames are supported (e.g. *.clash.dev, *.foo.*.example.com) # Non-wildcard domain names have a higher priority than wildcard domain names # e.g. foo.example.com > *.example.com > .example.com # P.S. +.foo.com equals to .foo.com and foo.com # hosts: # '*.clash.dev': 127.0.0.1 # '.dev': 127.0.0.1 # 'alpha.clash.dev': '::1' # profile: # Store the select results in $HOME/.config/clash/.cache # set false If you don't want this behavior # when two different configurations have groups with the same name, the selected values are shared # store-selected: true # persistence fakeip # store-fake-ip: false # DNS server settings # This section is optional. When not present, the DNS server will be disabled. dns: enable: false listen: 0.0.0.0:53 # ipv6: false # when the false, response to AAAA questions will be empty # These nameservers are used to resolve the DNS nameserver hostnames below. # Specify IP addresses only default-nameserver: - 114.114.114.114 - 8.8.8.8 # enhanced-mode: fake-ip fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR # use-hosts: true # lookup hosts and return IP record # search-domains: [local] # search domains for A/AAAA record # Hostnames in this list will not be resolved with fake IPs # i.e. questions to these domain names will always be answered with their # real IP addresses # fake-ip-filter: # - '*.lan' # - localhost.ptlogin2.qq.com # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. # All DNS questions are sent directly to the nameserver, without proxies # involved. Clash answers the DNS question with the first result gathered. nameserver: - 114.114.114.114 # default value - 8.8.8.8 # default value - tls://dns.rubyfish.cn:853 # DNS over TLS - https://1.1.1.1/dns-query # DNS over HTTPS - dhcp://en0 # dns from dhcp # - '8.8.8.8#en0' # When fallback is present, the DNS server will send concurrent requests # to the servers in this section along with servers in nameservers. # The answers from fallback servers are used when the GEOIP country # is not CN. # fallback: # - tcp://1.1.1.1 # - 'tcp://1.1.1.1#en0' # If IP addresses resolved with servers in nameservers are in the specified # subnets below, they are considered invalid and results from fallback # servers are used instead. # # IP address resolved with servers in nameserver is used when # fallback-filter.geoip is true and when GEOIP of the IP address is CN. # # If fallback-filter.geoip is false, results from nameserver nameservers # are always used if not match fallback-filter.ipcidr. # # This is a countermeasure against DNS pollution attacks. # fallback-filter: # geoip: true # geoip-code: CN # ipcidr: # - 240.0.0.0/4 # domain: # - '+.google.com' # - '+.facebook.com' # - '+.youtube.com' # Lookup domains via specific nameservers # nameserver-policy: # 'www.baidu.com': '114.114.114.114' # '+.internal.crop.com': '10.0.0.1' proxies: # Shadowsocks # The supported ciphers (encryption methods): # aes-128-gcm aes-192-gcm aes-256-gcm # aes-128-cfb aes-192-cfb aes-256-cfb # aes-128-ctr aes-192-ctr aes-256-ctr # rc4-md5 chacha20-ietf xchacha20 # chacha20-ietf-poly1305 xchacha20-ietf-poly1305 - name: "ss1" type: ss server: server port: 443 cipher: chacha20-ietf-poly1305 password: "password" # udp: true - name: "ss2" type: ss server: server port: 443 cipher: chacha20-ietf-poly1305 password: "password" plugin: obfs plugin-opts: mode: tls # or http # host: bing.com - name: "ss3" type: ss server: server port: 443 cipher: chacha20-ietf-poly1305 password: "password" plugin: v2ray-plugin plugin-opts: mode: websocket # no QUIC now # tls: true # wss # skip-cert-verify: true # host: bing.com # path: "/" # mux: true # headers: # custom: value # vmess # cipher support auto/aes-128-gcm/chacha20-poly1305/none - name: "vmess" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto # udp: true # tls: true # skip-cert-verify: true # servername: example.com # priority over wss host # network: ws # ws-opts: # path: /path # headers: # Host: v2ray.com # max-early-data: 2048 # early-data-header-name: Sec-WebSocket-Protocol - name: "vmess-h2" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto network: h2 tls: true h2-opts: host: - http.example.com - http-alt.example.com path: / - name: "vmess-http" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto # udp: true # network: http # http-opts: # # method: "GET" # # path: # # - '/' # # - '/video' # # headers: # # Connection: # # - keep-alive - name: vmess-grpc server: server port: 443 type: vmess uuid: uuid alterId: 32 cipher: auto network: grpc tls: true servername: example.com # skip-cert-verify: true grpc-opts: grpc-service-name: "example" # socks5 - name: "socks" type: socks5 server: server port: 443 # username: username # password: password # tls: true # skip-cert-verify: true # udp: true # http - name: "http" type: http server: server port: 443 # username: username # password: password # tls: true # https # skip-cert-verify: true # sni: custom.com # Snell # Beware that there's currently no UDP support yet - name: "snell" type: snell server: server port: 44046 psk: yourpsk # version: 2 # obfs-opts: # mode: http # or tls # host: bing.com # Trojan - name: "trojan" type: trojan server: server port: 443 password: yourpsk # udp: true # sni: example.com # aka server name # alpn: # - h2 # - http/1.1 # skip-cert-verify: true - name: trojan-grpc server: server port: 443 type: trojan password: "example" network: grpc sni: example.com # skip-cert-verify: true udp: true grpc-opts: grpc-service-name: "example" - name: trojan-ws server: server port: 443 type: trojan password: "example" network: ws sni: example.com # skip-cert-verify: true udp: true # ws-opts: # path: /path # headers: # Host: example.com # ShadowsocksR # The supported ciphers (encryption methods): all stream ciphers in ss # The supported obfses: # plain http_simple http_post # random_head tls1.2_ticket_auth tls1.2_ticket_fastauth # The supported supported protocols: # origin auth_sha1_v4 auth_aes128_md5 # auth_aes128_sha1 auth_chain_a auth_chain_b - name: "ssr" type: ssr server: server port: 443 cipher: chacha20-ietf password: "password" obfs: tls1.2_ticket_auth protocol: auth_sha1_v4 # obfs-param: domain.tld # protocol-param: "#" # udp: true proxy-groups: # relay chains the proxies. proxies shall not contain a relay. No UDP support. # Traffic: clash http vmess ss1 ss2 Internet - name: "relay" type: relay proxies: - http - vmess - ss1 - ss2 # url-test select which proxy will be used by benchmarking speed to a URL. - name: "auto" type: url-test proxies: - ss1 - ss2 - vmess1 # tolerance: 150 # lazy: true url: 'http://www.gstatic.com/generate_204 ' interval: 300 # fallback selects an available policy by priority. The availability is tested by accessing an URL, just like an auto url-test group. - name: "fallback-auto" type: fallback proxies: - ss1 - ss2 - vmess1 url: 'http://www.gstatic.com/generate_204 ' interval: 300 # load-balance: The request of the same eTLD+1 will be dial to the same proxy. - name: "load-balance" type: load-balance proxies: - ss1 - ss2 - vmess1 url: 'http://www.gstatic.com/generate_204 ' interval: 300 # strategy: consistent-hashing # or round-robin # select is used for selecting proxy or proxy group # you can use RESTful API to switch proxy is recommended for use in GUI. - name: Proxy type: select # disable-udp: true # filter: 'someregex' proxies: - ss1 - ss2 - vmess1 - auto # direct to another interfacename or fwmark, also supported on proxy - name: en1 type: select interface-name: en1 routing-mark: 6667 proxies: - DIRECT - name: UseProvider type: select use: - provider1 proxies: - Proxy - DIRECT proxy-providers: provider1: type: http url: "https://node.freev2raynode.com/uploads/2025/08/1-20250807.yaml " interval: 3600 path: ./provider1.yaml health-check: enable: true interval: 600 # lazy: true url: http://www.gstatic.com/generate_204 test: type: file path: /test.yaml health-check: enable: true interval: 36000 url: http://www.gstatic.com/generate_204 tunnels: # one line config - tcp/udp,127.0.0.1:6553,114.114.114.114:53,proxy - tcp,127.0.0.1:6666,rds.mysql.com:3306,vpn # full yaml config - network: [tcp, udp] address: 127.0.0.1:7777 target: target.com proxy: proxy rules: - DOMAIN-SUFFIX,google.com,auto - DOMAIN-KEYWORD,google,auto - DOMAIN,google.com,auto - DOMAIN-SUFFIX,ad.com,REJECT - SRC-IP-CIDR,192.168.1.201/32,DIRECT # optional param "no-resolve" for IP rules (GEOIP, IP-CIDR, IP-CIDR6) - IP-CIDR,127.0.0.0/8,DIRECT - GEOIP,CN,DIRECT - DST-PORT,80,DIRECT - SRC-PORT,7777,DIRECT - RULE-SET,apple,REJECT # Premium only - MATCH,auto
Tim (106420 rep)
Aug 6, 2025, 08:15 PM • Last activity: Aug 7, 2025, 09:30 AM
1 votes
0 answers
23 views
GRUB not booting any more after system update: How to set the root variable the correct way?
Today I ran an upgrade on one of my debian 11 VMs to get the latest security updates. Obviously, the GRUB system has been broken by the update. The VM uses EFI, so there is a sort of "chainloading". First `EFI\debian\grub.cfg` is executed, which is a minimal configuration file that directs GRUB to t...
Today I ran an upgrade on one of my debian 11 VMs to get the latest security updates. Obviously, the GRUB system has been broken by the update. The VM uses EFI, so there is a sort of "chainloading". First EFI\debian\grub.cfg is executed, which is a minimal configuration file that directs GRUB to the main configuration file /boot/grub/grub.cfg. The main configuration file lets GRUB search for the wrong UUID when trying to determine the root environment variable. This prevents the system from booting. These are my file system UUIDs:
root@morn ~ # blkid
/dev/vda2: UUID="4963-B5C0" BLOCK_SIZE="4096" TYPE="vfat" PARTUUID="40d4aada-c48d-446d-87e0-8a3ca2514eaf"
/dev/vda1: UUID="7c91164d-298d-4ef8-9823-df48a13e5325" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="ea35937f-4329-4c09-a674-70b551e654d9"
As we can see, /dev/vda2 is the EFI partition, while /dev/vda1 is the partition the system should boot from. This is the respective snippet from my /boot/grub/grub.cfg:
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4963-B5C0' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 4963-B5C0
        echo    'Loading Linux 6.1.0-37-amd64 ...'
        linux   /boot/vmlinuz-6.1.0-37-amd64 root=UUID=7c91164d-298d-4ef8-9823-df48a13e5325 ro ipv6.disable=1 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.1.0-37-amd64
}
I have generated that grub.cfg the recommended way via update-grub from within the VM while it was running. Obviously, update-grub uses the wrong UUID when generating the search ... line. It uses the UUID of the EFI file system instead of the UUID of the linux root file system. Consequently, GRUB cannot boot because there is no kernel and no appropriate directory structure on the EFI partition. As mentioned above, this happens since I have installed updates for Debian 11 in that VM. I'd like to emphasize that this was not a version upgrade. The VM was on Debian 11 since quite a while, and GRUB and its associated tools always worked flawlessly until I had applied the missing updates. Of course, I now could simply edit /boot/grub/grub.cfg every time I have run update-grub, replacing the search ... line by something like set root=(hd0,gpt1). But this approach is not recommended, and it is error prone. On the other hand, changing the custom scripts in /etc/grub.d doesn't seem reasonable as well. Does anybody know another way to tell update-grub the correct UUID for that search ... stanza? If memory serves me correctly, we can disable the UUID search using "official" methods, but that seems a bad idea, and I really would like to learn how to tell GRUB the correct UUID and make it behave as before the upgrade. Another solution would be to not care about the root variable at all and simply prepend (hd0,gpt1) before the linux and the initrd path. But I don't know a reasonable (safe for upgrades) way to do that either. **EDIT / UPDATE 2025-08-07 #1** In the meantime, I have researched further and have found something that is very suspicious and nearly surely causes the problem. Please consider the following snippet from the terminal in the VM in question:
root@morn /etc/grub.d # blkid
/dev/vda2: UUID="4963-B5C0" BLOCK_SIZE="4096" TYPE="vfat" PARTUUID="40d4aada-c48d-446d-87e0-8a3ca2514eaf"
/dev/vda1: UUID="7c91164d-298d-4ef8-9823-df48a13e5325" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="ea35937f-4329-4c09-a674-70b551e654d9"

root@morn /etc/grub.d # fdisk -l /dev/vda
Disk /dev/vda: 112 GiB, 120259084288 bytes, 29360128 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8C7D0CC5-3D22-490E-A1CC-92DA49B5D125

Device      Start      End  Sectors   Size Type
/dev/vda1  131072 29360122 29229051 111.5G Linux filesystem
/dev/vda2   16384   131071   114688   448M EFI System

Partition table entries are not in disk order.

root@morn /etc/grub.d # mount |grep /dev/vda
/dev/vda1 on / type ext4 (rw,relatime,quota,usrquota,grpquota,errors=remount-ro)
So far, we once again see without any doubt that the root file system ('/') is mounted on vda1 and that it is an ext4 file system with UUID 7c91164d-298d-4ef8-9823-df48a13e5325. Furthermore, the two file systems on vda definitely have different UUIDs. And now GRUB seems to have a massive bug:
root@morn /etc/grub.d # grub-probe -d /dev/vda1; grub-probe -d /dev/vda2
fat
fat

root@morn /etc/grub.d # grub-probe -t fs_uuid -d /dev/vda1; grub-probe -t fs_uuid -d /dev/vda2
4963-B5C0
4963-B5C0

root@morn /etc/grub.d # grub-probe /; grub-probe -t fs_uuid /
fat
4963-B5C0
So GRUB obviously has come to the conclusion that both file systems (on vda1 and vda2, respectively) are FAT, that they both have the same UUID (4963-B5C0), and that / is mounted on a FAT file system with that UUID. Of course, this is complete nonsense and clearly contradicts the output of blkid, mount and fdisk. Any ideas?
Binarus (3891 rep)
Aug 6, 2025, 06:26 PM • Last activity: Aug 7, 2025, 05:58 AM
5 votes
1 answers
2672 views
Mint 17.1 - installation reverts to Grub - UUI
I'm attempting to install Mint 17.1 and have succesfully used Universal USB Installer to create a bootable USB stick. When booting up Mint the pleasing loading screen fails to make an appearance and instead the Grub menu is shown. How should I proceed to install Linux Mint on this machine? I have at...
I'm attempting to install Mint 17.1 and have succesfully used Universal USB Installer to create a bootable USB stick. When booting up Mint the pleasing loading screen fails to make an appearance and instead the Grub menu is shown. How should I proceed to install Linux Mint on this machine? I have attempted the same proces using YUMI but in this case the machine reverts to the BIOS settings instead of loading Mint / Grub from the USB stick. To clarify, I'm not intent on dual booting with Windows 8 but replacing the Windows installation with Mint.
Levon (151 rep)
Jan 2, 2015, 05:25 PM • Last activity: Jul 2, 2025, 05:00 PM
3 votes
3 answers
6194 views
What command always generates the same UUID through /proc/sys/kernel
Running the following command generates different random output on each execution (which is expected, considering that `random` is in the path): cat /proc/sys/kernel/random/uuid Is there any way to modify the path so that it results in a static (not random) UUID on each call (return the same thing o...
Running the following command generates different random output on each execution (which is expected, considering that random is in the path): cat /proc/sys/kernel/random/uuid Is there any way to modify the path so that it results in a static (not random) UUID on each call (return the same thing on each request/execution instead of being random)?
Agi Hammerthief (622 rep)
Mar 8, 2017, 09:39 AM • Last activity: Jun 25, 2025, 11:46 PM
0 votes
1 answers
5846 views
How to convert grub config to use kernel device names instead of UUID
I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation. I've set up clonezilla on PXE server. After appling the disk-image of on another machine, it fails to boot. This is because all the partitions are referred to be their UUIDs instead of the kernel-assi...
I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation. I've set up clonezilla on PXE server. After appling the disk-image of on another machine, it fails to boot. This is because all the partitions are referred to be their UUIDs instead of the kernel-assigned name (sda1, sda2, etc). How do I configure grub to be using the kernel names instead of the UUID so that the image can be truly ported to the other systems? I have tried setting GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub and then run grub2-mkconfig -o /boot/grub2/grub.cfg. I have also changed the entry in /etc/fstab. After these changes, the system still boots fine on the source machine, but doesn't boot on all the others. Grub loads, but only shows the word "GRUB" and thats all. Nothing else happens. My current grub.cfg is the following: # # DO NOT EDIT THIS FILE # # It is automatically generated by grub2-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then load_env fi set default="${saved_entry}" if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi export menuentry_id_option if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi font="/usr/share/grub2/unicode.pf2" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi insmod gfxmenu loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2 insmod png set theme=($root)/boot/grub2/themes/openSUSE/theme.txt export theme if [ x${boot_once} = xtrue ]; then set timeout=0 elif sleep --interruptible 0 ; then set timeout=5 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'openSUSE 12.3' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 splash=silent acpi=on barrier=off reboot=pci init=linuxrc splash=silent quiet showopts echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } submenu 'Advanced options for openSUSE 12.3' $menuentry_id_option 'gnulinux-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' { menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 splash=silent acpi=on barrier=off reboot=pci init=linuxrc splash=silent quiet showopts echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default (recovery mode)' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-recovery-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/20_ppc_terminfo ### ### END /etc/grub.d/20_ppc_terminfo ### ### BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-52EA4C7AEA4C5C7B' { insmod part_msdos insmod ntfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 52EA4C7AEA4C5C7B else search --no-floppy --fs-uuid --set=root 52EA4C7AEA4C5C7B fi chainloader +1 } ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### ### BEGIN /etc/grub.d/90_persistent ### ### END /etc/grub.d/90_persistent ###
d_inevitable (271 rep)
May 13, 2013, 05:58 AM • Last activity: Jun 10, 2025, 03:02 PM
0 votes
1 answers
2137 views
RPI root partition lost PARTUUID and can't boot
So I cloned a RPI sd card so I could run the same system at home and at work. The sd cards were slightly different sizes so after I ran dd I had to run resize2fs and fsck. If I boot the Pi with this I get dropped to an emergency shell and I can mount the root partition and it works. The problem: I n...
So I cloned a RPI sd card so I could run the same system at home and at work. The sd cards were slightly different sizes so after I ran dd I had to run resize2fs and fsck. If I boot the Pi with this I get dropped to an emergency shell and I can mount the root partition and it works. The problem: I need this to run headless and I cant mount the root partition every time it starts. When the Pi boots it looks for PARTUUID="ceafa322-02". If I could change the pi to boot from the new root UUID or something that would be fine, but I don't know the boot process on one of these. What I have been trying to do is modify the partition with fdisk, but I dont know how an identifier like 0xXXXXXXXX translates to ceafa322-02 as a PARTUUID What is the best course of action? I can nuke the installment, but I am almost determined at this point.
ZenRen (31 rep)
May 6, 2020, 08:20 PM • Last activity: Apr 27, 2025, 05:02 PM
0 votes
2 answers
2652 views
Black arch Boot problem, UUID not found
I’ve installed black arch “from live iso” and it was installed successfully But after reboot it stuck in black screen starting version 245.5-2-arch ERROR: device ‘uuid=xxxxxxxxxx‘ not found skipping fsck. mount: /new_root: can’t find UUID=xxxxxxx. You are now being dropped into an emergency shell. s...
I’ve installed black arch “from live iso” and it was installed successfully But after reboot it stuck in black screen starting version 245.5-2-arch ERROR: device ‘uuid=xxxxxxxxxx‘ not found skipping fsck. mount: /new_root: can’t find UUID=xxxxxxx. You are now being dropped into an emergency shell. sh: can’t access tty; job control turned off[rootfs ]# By the way I think this picture may help to fix this appears while installing How can I fix this error ?
Dr.Eissa (447 rep)
Jun 12, 2020, 07:01 PM • Last activity: Apr 16, 2025, 10:00 AM
3 votes
1 answers
2044 views
UUID's when changing hardware
In `/etc/sysconfig/network-scripts/ifcfg-eno1` there is a UUID to identify the on-board network interface. I also notice now that some partitions in `fstab` are also identified by a UUID. If I remove the hard drives from this server and put them into a new "identical" server, will everything still w...
In /etc/sysconfig/network-scripts/ifcfg-eno1 there is a UUID to identify the on-board network interface. I also notice now that some partitions in fstab are also identified by a UUID. If I remove the hard drives from this server and put them into a new "identical" server, will everything still work as expected? I doubt there would be an issue with the HDD's, as the UUID's will move with them, but will there be some sort of mismatch on the network UUIDs, as the hardware has changed? It stands to reason that if I have a faulty system board, I will want to move the storage into a spare server and have everything working again quickly. Are the network interface UUID's only used by Network Manager? I have that disabled, so perhaps it's a good idea to simply remove the UUID entry from the config file anyway.
Chris (31 rep)
Apr 20, 2018, 02:35 PM • Last activity: Apr 5, 2025, 02:06 AM
32 votes
8 answers
124564 views
UUID of a drive that won't show up in /dev/disk/by-uuid or blkid
I have a USB drive that is not receiving a UUID. When I look at the contents of the /dev/disk/by-uuid it doesn't exist there. The dev point that the partition lives in is on /dev/sdb. I am able to see sdb under /dev/disk/by-path. Also, when using blkid, I get zero output. I'm assuming that I got an...
I have a USB drive that is not receiving a UUID. When I look at the contents of the /dev/disk/by-uuid it doesn't exist there. The dev point that the partition lives in is on /dev/sdb. I am able to see sdb under /dev/disk/by-path. Also, when using blkid, I get zero output. I'm assuming that I got an error code that returned back. Is there a way to get a UUID for this partition? Result of fdisk -l /dev/sdb: Disk /dev/sdb: 320.1 GB, 320072932352 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142446 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00082145 Device Boot Start End Blocks Id System /dev/sdb1 2048 625141759 312569856 83 Linux The partition table and partition was created with gparted, so it was partitioned and ran the command mkfs.ext3. Output of fsck -n /dev/sdb1: fsck from util-linux 2.20.1 e2fsck 1.42 (29-Nov-2011) fsck.ext2: Superblock invalid, trying backup blocks... zwei was not cleanly unmounted, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information zwei: 11/19537920 files (0.0% non-contiguous), 1275097/78142464 blocks It was formatted as an ext3 drive. Why is that showing up as ext2?
monksy (773 rep)
Feb 11, 2013, 08:32 PM • Last activity: Mar 31, 2025, 03:40 PM
6 votes
3 answers
1413 views
Changing HFSPlus UUID from PartedMagic
I needed to make a clone of my hard drive recently (bad blocks FTW). I was using Clonezilla at the time. However, Clonezilla refused to copy the HFS+ partition, so I did it manually. The problem is that the UUIDs are out of sync. What is the command to set a specific UUID for HFS+?
I needed to make a clone of my hard drive recently (bad blocks FTW). I was using Clonezilla at the time. However, Clonezilla refused to copy the HFS+ partition, so I did it manually. The problem is that the UUIDs are out of sync. What is the command to set a specific UUID for HFS+?
Kaz Wolfe (495 rep)
Sep 7, 2014, 05:45 AM • Last activity: Mar 16, 2025, 06:40 AM
1 votes
3 answers
13937 views
Stuck in initramfs after reboot
I got that error already twice while having my laptop, and I previously were able to fix it after them google search and switching to AHCI in BIOS. However, this time it seems to be another problem because even though sata-mode is AHCI it kicks me back to initramfs. I tried this, [How to switch from...
I got that error already twice while having my laptop, and I previously were able to fix it after them google search and switching to AHCI in BIOS. However, this time it seems to be another problem because even though sata-mode is AHCI it kicks me back to initramfs. I tried this, How to switch from IDE to AHCI , with the hope to not get that error in the future. After that I sadly got the error that I am now stuck on. Original error message ![Original error message ][2] Output from cat /proc/modules and ls dev ![Output from cat /proc/modules and ls dev ][3] Help is greatly appreciated.
Yanis Wilbrand (11 rep)
Nov 11, 2021, 05:30 PM • Last activity: Feb 19, 2025, 04:58 AM
2 votes
0 answers
66 views
3 NVME Acer 2TB drives have the same Hardware UUID?
The Question: Is it normal for three drives made by the same manufacturer (all having the same capacity 2TB in this case) to have the same Hardware UUID in Linux? _Not the partitions, the hardware._ The Details: * Over the course of a year, I purchased three Acer 2TB NVME Drives from Newegg. I had i...
The Question: Is it normal for three drives made by the same manufacturer (all having the same capacity 2TB in this case) to have the same Hardware UUID in Linux? _Not the partitions, the hardware._ The Details: * Over the course of a year, I purchased three Acer 2TB NVME Drives from Newegg. I had installed two of them in the same Notebook (Acer Nitro 2022), and while using Windows they worked without error. * I recently installed Fedora 41 on the Acer Nitro 2022, and while in the Anaconda installer, Anaconda threw an error/warning that there were two devices with the same Hardware UUID. I ended up having to remove one to finish the installation. * I was curious since I have another Notebook with one of these Acer 2TB NVME drives, so I ran the following command on both Notebooks to see if the Nitro error was a fluke:
-sh
    ls -la /dev/disk/by-id
For both Notebooks, the same Hardware UUID is reported under the device nvme0n1:
nvme-uuid.df8e86d6-8a47-9916-2e43-8e8b6efdb7cd
Ryan N. (21 rep)
Dec 16, 2024, 12:29 AM • Last activity: Jan 8, 2025, 08:47 AM
3 votes
3 answers
9567 views
Get the same UUID on different Linux distributions
# dmidecode --string system-uuid I'm using the code above get the UUID on each host in my environment. As far as I understand the UUID should not change between different Linux distributions on the same host with the same hardware configuration. But after some tests on different Linux distributions...
# dmidecode --string system-uuid I'm using the code above get the UUID on each host in my environment. As far as I understand the UUID should not change between different Linux distributions on the same host with the same hardware configuration. But after some tests on different Linux distributions I encountered different uuid with this same command. It seems that older dmidecode version will get different UUID result. For example dmidecode 2.9 from SLES11.2 result with string A and dmidecode 2.12 from Debian 8 result with string B. How can I get the same uuid no matter the Linux distribution I deploy on my machine? **Additional information:** I wanted to use dmidecode and not MAC address as UUID because i saw that if I replace my network adapter or some other hardware's settings the UUID will not change. What I need is some unique identifier that I can have on my machine to identify it across minor hardware changes and different OS. Using dmidecode cannot be fake in some level I guess instead of just generating UUID and writing it to a file and using it. I'm working with VMware and machine clones are often used and that's why I need something that will not be replicated with the clone.
Asaf Magen (547 rep)
Jun 22, 2015, 12:15 PM • Last activity: Dec 30, 2024, 03:58 PM
8 votes
3 answers
17396 views
Is machine-id a uuid?
I searched my question and none of them answered me: Is machine-id as unique as mainboard UUID (fetched by "get csproduct UUID" command on windows)? And is enough reliable to bind a license on machine-id beside mac address? Or what is uuid on *nix system that can be used for licensing?
I searched my question and none of them answered me: Is machine-id as unique as mainboard UUID (fetched by "get csproduct UUID" command on windows)? And is enough reliable to bind a license on machine-id beside mac address? Or what is uuid on *nix system that can be used for licensing?
Nima (91 rep)
Sep 30, 2017, 03:56 PM • Last activity: Dec 2, 2024, 03:58 PM
1 votes
1 answers
91 views
Unique device path for generic SCSI device /dev/sgX
[This is on Debian 12] To fully access my DVD drive, I need to also know its SCSI generic path (`/dev/sgX`) in addition to its expected CDROM-`/dev/srX` path. The specific device is important, though, and I need to access the device even if the system re-shuffles the `/dev/srX`s and `/dev/sgX`s. ```...
[This is on Debian 12] To fully access my DVD drive, I need to also know its SCSI generic path (/dev/sgX) in addition to its expected CDROM-/dev/srX path. The specific device is important, though, and I need to access the device even if the system re-shuffles the /dev/srXs and /dev/sgXs.
sudo lsscsi -g
[3:0:0:0]    cd/dvd  HL-DT-ST BD-RE  WH16NS60  1.05  /dev/sr0   /dev/sg3
sudo blkid /dev/sr0
/dev/sr0: UUID="035bbeef20202020" LABEL="WALDEINSAMKEIT" BLOCK_SIZE="2048" TYPE="udf"

sudo blkid /dev/sg3
/dev/sr0 is set with a /dev/disk/by-uuid/035bbeef20202020 but if /dev/sg3 doesn't actually have a UUID (I'm guessing it's not seen as a block device), I could go for the full controller/system path, per this Linus rant I found https://yarchive.net/comp/linux/scsi_ids.html
sudo udevadm info -q path -n /dev/sr0
/devices/pci0000:00/0000:00:17.0/ata4/host3/target3:0:0/3:0:0:0/block/sr0

sudo udevadm info -q path -n /dev/sg3
/devices/pci0000:00/0000:00:17.0/ata4/host3/target3:0:0/3:0:0:0/scsi_generic/sg3
This does not seem like a solution either, as the path includes sr0 or sg3 which will change order. /sys/devices/pci0000:00/0000:00:17.0/ata4/host3/target3:0:0/3:0:0:0 seems to be a directory the device is referencing but I can't find anything more than the folders block/sr0 and scsi_generic/sg3 which again revert to the original problem of sr0 and sg3 changing if the system cables are reordered or something. How can I get a consistent identifier for /dev/sg3? I have searched hard, but I must be missing a command.
user2403531 (113 rep)
Nov 19, 2024, 10:27 PM • Last activity: Nov 20, 2024, 12:35 PM
29 votes
4 answers
49706 views
Create unique random numbers (UUIDs) in bash
I want to create random unique numbers (UUIDs) as the following node.id=ffffffff-ffff-ffff-ffff-ffffffffffff First I tried this $ rndnum=` echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM` $ echo $rndnum 30380-echo 21875-echo 14791-echo 32193-echo 11503 What is the right way...
I want to create random unique numbers (UUIDs) as the following node.id=ffffffff-ffff-ffff-ffff-ffffffffffff First I tried this $ rndnum= echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM"-"echo $RANDOM $ echo $rndnum 30380-echo 21875-echo 14791-echo 32193-echo 11503 What is the right way to create the following (where f is any number)? ffffffff-ffff-ffff-ffff-ffffffffffff
yael (13936 rep)
Feb 14, 2019, 09:34 AM • Last activity: Jul 1, 2024, 03:48 PM
3 votes
1 answers
328 views
changing uuid of /run/media/root/ partition
I have a usb disk and after formatting it shows up as `/run/media/root/abc213` where *abc123* is some much longer complex string that no normal person would be able to remember... typical of what you would see for UUID's in `/etc/fstab`. Is there a way to change this uuid string on my usb disk after...
I have a usb disk and after formatting it shows up as /run/media/root/abc213 where *abc123* is some much longer complex string that no normal person would be able to remember... typical of what you would see for UUID's in /etc/fstab. Is there a way to change this uuid string on my usb disk after I have that partition formatted as XFS? Such that I could make its UUID one single character, and if so how?
ron (8647 rep)
Jun 17, 2024, 01:23 PM • Last activity: Jun 17, 2024, 01:31 PM
0 votes
1 answers
2243 views
how to mount [bind] an external hard drive folder using UUID to another folder on a pc
**in short:** ------------- on pc: /home/user/Music: ├─music_from_disk_1 └─music_from_disk_2 on 2 HDD's in root: /music, /docs, /photos. need to automatically mount `HDD1/music` to `.../music_from_disk_1` and `HDD2/music` to `.../music_from_disk_2` regardless of the number of previously mounted file...
**in short:** ------------- on pc: /home/user/Music: ├─music_from_disk_1 └─music_from_disk_2 on 2 HDD's in root: /music, /docs, /photos. need to automatically mount HDD1/music to .../music_from_disk_1 and HDD2/music to .../music_from_disk_2 regardless of the number of previously mounted file systems from other devices and from the sequence of connecting the hard disk drives. **detailed:** ------------- i have 2 HDD. UUID HDD1 is 4E1AE and UUID2 is A7B1A. there are /music, /docs, /photos folders exists in root on each HDD. in pc/music i have 2 folders. one for each HDD/music folder : /home/user/Music: ├─music_from_disk_1 └─music_from_disk_2 and the same hierarchy for photos. I need to set everything up so that when the HDD1 is connected, the /music folder from HDD1 is automatically mounted into /home/user/Music/music_from_disk_1. and then i plug in HDD2. /music from HDD2 mounted into /home/user/Music/music_from_disk_2. and for /docs, /photos folders the same way. and no matter what the sequence of connecting the disks and how many other disks and devices I have already mounted. using UUIDs just to avoid confusion. if there are other more convenient options, of course I will use them. it doesn't work for me. maybe I'm misusing it or don't know the additional options: > i know how to mount folder to folder. sudo mount --bind /from /to > and in /etc/fstab wrote /from /to none bind 0 0. so that after > rebooting everything is mounted again. > > it works only when you know where HDD[1|2] is mounted now. > and also know how to mount HDD partition to some folder using UUID: > `/dev/disk/by-uuid/4E1AE /home/user/Music/ auto > nosuid,nodev,nofail,x-gvfs-show 0 0` Gnome Disk Utility wrote it in > /etc/fstab. "Edit Mount Options"->"Automatic Mount Options". > > partition to folder but not folder to folder. if there is no simple solution, can i probably use the bash(or other) script to check the UUID and mount it in the appropriate folders? I don't know how to write it and don't know how to automatically launch script when any device is connected. I also know that there is a way to combine 2 partitions into one when mounting without using raid, but I don't need it. i have Ubuntu 20.04 installed.
NikolayFR (1 rep)
Aug 14, 2020, 02:44 PM • Last activity: May 31, 2024, 01:07 AM
0 votes
2 answers
178 views
Rename file and convert to lowercase
This command is to rename files using `uuidgen`: ``` zmv '(*)(.*)' '`uuidgen | head -c 8`$2' ``` Could someone show how to convert resulting string to lowercase?
This command is to rename files using uuidgen:
zmv '(*)(.*)' 'uuidgen | head -c 8$2'
Could someone show how to convert resulting string to lowercase?
jsx97 (1347 rep)
May 21, 2024, 01:50 PM • Last activity: May 21, 2024, 06:09 PM
142 votes
8 answers
353419 views
How can I look up a username by id in linux?
The command `id` can be used to look up a user's `uid`, for example: $ id -u ubuntu 1000 Is there a command to lookup up a username from a `uid`? I realize this can be done by looking at the `/etc/passwd` file but I'm asking if there is an existing command to to this, especially if the user executin...
The command id can be used to look up a user's uid, for example: $ id -u ubuntu 1000 Is there a command to lookup up a username from a uid? I realize this can be done by looking at the /etc/passwd file but I'm asking if there is an existing command to to this, especially if the user executing it is not root. I'm not looking for the *current* user's username, i.e. I am not looking for whoami or logname. This also made me wonder if on shared web hosting this is a security feature, or am I just not understanding something correctly? For examination, the /etc/passwd file from a shared web host: root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin news:x:9:13:news:/etc/news: uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin gopher:x:13:30:gopher:/var/gopher:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin nscd:x:28:28:NSCD Daemon:/:/sbin/nologin vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin pcap:x:77:77::/var/arpwatch:/sbin/nologin rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin avahi:x:70:70:Avahi daemon:/:/sbin/nologin rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin haldaemon:x:68:68:HAL daemon:/:/sbin/nologin xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin avahi-autoipd:x:100:104:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin named:x:25:25:Named:/var/named:/sbin/nologin mailman:x:32006:32006::/usr/local/cpanel/3rdparty/mailman/mailman:/usr/local/cpanel/bin/noshell dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin mysql:x:101:105:MySQL server:/var/lib/mysql:/bin/bash cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell nagios:x:102:106:nagios:/var/log/nagios:/bin/sh ntp:x:38:38::/etc/ntp:/sbin/nologin myuser:x:1747:1744::/home/myuser:/usr/local/cpanel/bin/jailshell And here is a sample directory listing of /tmp/ drwx------ 3 root root 1024 Apr 16 02:09 spamd-22217-init/ drwxr-xr-x 2 665 664 1024 Apr 4 00:05 update-cache-44068ab4/ drwxr-xr-x 4 665 664 1024 Apr 17 15:17 update-extraction-44068ab4/ -rw-rw-r-- 1 665 664 43801 Apr 17 15:17 variable.zip -rw-r--r-- 1 684 683 4396 Apr 17 07:01 wsdl-13fb96428c0685474db6b425a1d9baec We can see root is the owner of some files, and root is also showing up in /etc/passwd , however the other users/groups all show up as numbers.
cwd (46887 rep)
Apr 17, 2012, 01:29 AM • Last activity: Apr 10, 2024, 07:11 AM
Showing page 1 of 20 total questions