Welcome to the Linux Foundation Forum!

Why is it that..?

LFS207/chapter20/Disk Partitioning:

$ sudo blkid

Why is it that when i type that command, in ubuntu it works fine, but when i try that same comand on debian 12, i get the cannot find command output, although there is a man page, no matter if try with sudo or as root?

thanks and regards

berni

Best Answers

  • luisviveropena
    luisviveropena Posts: 1,306
    Answer ✓

    Hi Berni,

    I downloaded and installed Debian 13.2 and I wasn't able to reproduce your issue, because it worked in my VM:

    luis@debiansrv:~$ cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
    NAME="Debian GNU/Linux"
    VERSION_ID="13"
    VERSION="13 (trixie)"
    VERSION_CODENAME=trixie
    DEBIAN_VERSION_FULL=13.2
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

    luis@debiansrv:~$ sudo blkid
    [sudo] password for luis:
    /dev/sda5: UUID="3e49a5e5-e453-481b-929a-a172e0372bba" TYPE="swap" PARTUUID="adca020b-05"
    /dev/sda1: UUID="38aad7f6-0ea9-456b-b174-78d5224318cb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="adca020b-01"

    luis@debiansrv:~$ which blkid
    luis@debiansrv:~$ sudo which blkid
    /usr/sbin/blkid

    luis@debiansrv:~$ apt search blkid
    libblkid-dev/stable 2.41-5 amd64
    block device ID library - headers

    libblkid1/stable,now 2.41-5 amd64 [installed]
    block device ID library

    This was just to see which package is providing the binary.

    So, in your case instead of using sudo, do the following:

    luis@debiansrv:~$ su -
    Password:
    root@debiansrv:~# blkid
    /dev/sda5: UUID="3e49a5e5-e453-481b-929a-a172e0372bba" TYPE="swap" PARTUUID="adca020b-05"
    /dev/sda1: UUID="38aad7f6-0ea9-456b-b174-78d5224318cb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="adca020b-01"

    In this case, using 'su -', we are running the root's shell with root's permissions, so you should be able to run it.

    Please let me know.

    Regards,
    Luis.

  • luisviveropena
    luisviveropena Posts: 1,306
    Answer ✓

    Hi Berni,

    I think it's failing because it's not taking the root's PATH environment variable. So, when you do 'su', you get a login with the root user. When you do 'su -', you get a login with the root user with it's environment variables. So I guess you are just missing the root's PATH when you run the command.

    Regards and happy New Year!
    Luis.

  • luisviveropena
    luisviveropena Posts: 1,306
    Answer ✓

    Hi Berni,

    It's in the 'man su' page. Perhaps it's not so clear, but it also takes training and practice.

    Thanks, happy New Year to you as well!!

    Luis.

Answers

  • and here is the screenshot according the above question...

  • Hi Luis,

    no it did not function according to the screenshot, what could be the reason?

    regards berni

  • Hi Luis,
    thanks i did not know the difference between su and su - where can i find more information about that because in the lfs 101 and also at this course it was not explained yet but it solves some of my questions...thanks a lot and happy new year and regards

    berni

Categories

Upcoming Training