Git Product home page Git Product logo

util-linux's Introduction

				  util-linux

		util-linux is a random collection of Linux utilities

     Note: for the years 2006-2010 this project was named "util-linux-ng".

COMPILE & INSTALL:

      See Documentation/howto-compilation.txt.

MAILING LIST:

      E-MAIL:  [email protected]
      URL:     http://vger.kernel.org/vger-lists.html#util-linux
      ARCHIVE: https://lore.kernel.org/util-linux/

      The mailing list will reject email messages that contain:
       - more than 100K characters
       - html
       - spam phrases/keywords
      See: http://vger.kernel.org/majordomo-info.html#taboo

IRC CHANNEL:

      #util-linux at libera.chat:

      irc://irc.libera.chat/util-linux

      The IRC channel and Mailing list are for developers and project
      maintainers. For end users it is recommended to utilize the
      distribution's support system.

BUG REPORTING:

      E-MAIL: [email protected]
      Web:    https://github.com/util-linux/util-linux/issues

      Bug reports with sensitive or private information: Karel Zak <[email protected]>

      This project has no resources to provide support for distribution specific
      issues. For end users it is recommended to utilize the distribution's
      support system.

NLS (PO TRANSLATIONS):

      PO files are maintained by:
	  https://translationproject.org/domain/util-linux.html

VERSION SCHEMA:

      Standard releases:
	  <major>.<minor>[.<maint>]
	     major = fatal and deep changes
	     minor = typical release with new features
	     maint = maintenance releases; bug fixes only

      Development releases:
	 <major>.<minor>-rc<N>

SOURCE CODE:

 Download archive:
	  https://www.kernel.org/pub/linux/utils/util-linux/

 See also:
     Documentation/howto-contribute.txt
     Documentation/howto-build-sys.txt
     Documentation/howto-pull-request.txt

 SCM (Source Code Management) Repository:

    Primary repository:
	  git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git

    Backup repository:
	  git clone https://github.com/util-linux/util-linux.git

    Web interfaces:
	  https://git.kernel.org/cgit/utils/util-linux/util-linux.git
	  https://github.com/util-linux/util-linux

      Note: the GitHub repository may contain temporary development branches too.

      The kernel.org repository contains master (current development) and stable/*
      (maintenance) branches only. All master or stable/* changes are always pushed
      to both repositories at the same time.

    Repository Branches: 'git branch -a'
	  master branch
	   - current development
	   - the source for stable releases when deemed ready.
	   - day-to-day status is: 'it works for me'. This means that its
	     normal state is useful but not well tested.
	   - long-term development or invasive changes in active development are
	     forked into separate 'topic' branches from the tip of 'master'.

	  stable/ branches
	   - public releases
	   - branch name: stable/v<major>.<minor>.
	   - created from the 'master' branch after two or more release
	     candidates and the final public release. This means that the stable
	     releases are committed, tagged, and reachable in 'master'.
	   - these branches then become forked development branches. This means
	     that any changes made to them diverge from the 'master' branch.
	   - maintenance releases are part of, and belong to, their respective
	     stable branch. As such, they are tags(<major>.<minor>.<maint>) and
	     not branches of their own. They are not part of, visible in, or
	     have anything to do with the 'master' development branch. In git
	     terminology: maintenance releases are not reachable from 'master'.
	   - when initially cloned (as with the 'git clone' command given above)
	     these branches are created as 'remote tracking branches' and are
	     only visible by using the -a or -r options to 'git branch'. To
	     create a local branch use the desired tag with this command:
	     'git checkout -b v2.29.2 v2.29.2'

    Tags: 'git tag'
	   - a new tag object is created for every release.
	   - tag name: v<version>.
	   - all tags are signed by the maintainer's PGP key.

    Known Bugs:
	- don't use tag v2.13.1 (created and published by mistake),
	  use v2.13.1-REAL instead.

WORKFLOW EXAMPLE:

 1) development (branch: <master>)

 2) master release (tags: v2.29-rc1, v2.29-rc2, v2.29, branch: <master>)

 3) development (work on v2.30, branch: <master>)

 4) fork -- create a new branch <stable/v2.29> based on tag v2.29

     4a) new patches or cherry-pick patches from <master> (branch: <stable/v2.29>)

     4b) stable release (tag: v2.29.1, branch: <stable/v2.29>)

     4c) more patches; another release (tag: v2.29.2, branch: <stable/v2.29>)

 5) master release v2.30 (branch: <master>)
    ...

where 3) and 4) happen simultaneously.

util-linux's People

Contributors

andhe avatar bernhard-voelker avatar cosoleto avatar evverx avatar falconindy avatar ferivoz avatar heicarst avatar ignatenkobrain avatar jwilk avatar karelzak avatar kerolasa avatar knot avatar mariobl avatar masatake avatar mbroz avatar meyering avatar mkerrisk avatar neheb avatar pali avatar peterbrei avatar pks-t avatar qboosh avatar rudimeier avatar stanislav-brabec avatar sthibaul avatar stoeckmann avatar t-8ch avatar vapier avatar yontalcar avatar yurchor avatar

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

util-linux's Issues

some libs are not found (can render system unbootable after install)

I downloaded this ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.1.tar.gz
unpacked it, did (EDIT: ./configure was first, obviously) make then sudo make install tested if blkdiscard works, seems to work, read it's man then later on rebooted but then mount wouldn't work...

this is what umount says ('cause I already fixed mount by then)

umount: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.25' not found (required by umount)
umount: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.23' not found (required by umount)
umount: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.22' not found (required by umount)
umount: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.21' not found (required by umount)
umount: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.24' not found (required by umount)

and lsblk:

lsblk: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.22' not found (required by lsblk)
lsblk: /lib/x86_64-linux-gnu/libmount.so.1: version `MOUNT_2.24' not found (required by lsblk)

this is under linux mint 15 Olivia 64bit

took a while to fix to be able to get back in 'cause of other issues that added to this;
I actually didn't realize it(the sudo make install) replaced the existing mount and a lot of others, I'm not really sure how to restore the originals, that is, I'd have to find out in which package are each of the replaced commands that fail to run and then from X run synaptic and set them for Reinstall (seems to have worked for the mount package so far)

Basically it's my fault here, I should've been more careful and not just sudo make install so eagerly. ;)

Peaces

cannot scan partitions on loop device

According to a comment in the kernel code partition scanning is disabled by default but can be requested from userspace. Losetup offers no option to enable scanning of partitions on configured device.

hexdump fails to parse format '/1 "\n"'.

$ echo "abc" | hexdump -e "/1 "\n""
hexdump: bad format {/1 n}

The fix is trivial, but as this is a "backup upstream repository", where is the best way to submit the patch?

login causes agetty to behave undesirablely

'agetty' as for a user name and passes it forward to 'login', but if 'login' fails to log in it will
ask for a new user name. And 'login' does not handle input in the same way as 'agetty'.

'login' should be able to ask for user names, and so should 'agetty', and they do not need
to behave the same way. But if 'login' is given a user name it should never as for a new one,
only for a new password and except the user to cancel using ^C or ^D if the username is
incorrect.

Minor output formatting regression in fdisk

I noticed recently that two entries in the output of my fdisk -l do not have a space between them. I bisected it to commit 4fdde14 (aka fdisk 2.25.90-4fdd)

There's a \n gone missing somewhere, from the end of the dmcrypt bit. Here's some sample output from the current stable, and current latest git version (they both have the issue):

$ /bin/fdisk --version
fdisk from util-linux 2.25.1
$ fdisk --version
fdisk from util-linux 2.25.213-286f1
$ /bin/fdisk -l

Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       2048 62333951 62331904 29.7G  c W95 FAT32 (LBA)

Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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
Disklabel type: dos
Disk identifier: 0xXXXXXXXX

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 234432511 234430464 111.8G  7 HPFS/NTFS/exFAT
/dev/sda2       234432512 273502591  39070080  18.6G 83 Linux
/dev/sda3       273502592 468862127 195359536  93.2G 83 Linux

Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Device        Start       End   Sectors   Size Type
/dev/sdb1      2048   2099199   2097152     1G EFI System
/dev/sdb2   2099200  69208063  67108864    32G Linux filesystem
/dev/sdb3  69208064 458328063 389120000 185.6G Linux filesystem

Disk /dev/mapper/steven: 185.6 GiB, 199227342848 bytes, 389115904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdc: 7.4 GiB, 7902068736 bytes, 15433728 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
Disklabel type: dos
Disk identifier: 0xd6ce0480

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 15433727 15431680  7.4G  c W95 FAT32 (LBA)

$ fdisk -l

Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       2048 62333951 62331904 29.7G  c W95 FAT32 (LBA)

Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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
Disklabel type: dos
Disk identifier: 0xXXXXXXXX

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 234432511 234430464 111.8G  7 HPFS/NTFS/exFAT
/dev/sda2       234432512 273502591  39070080  18.6G 83 Linux
/dev/sda3       273502592 468862127 195359536  93.2G 83 Linux

Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Device        Start       End   Sectors   Size Type
/dev/sdb1      2048   2099199   2097152     1G EFI System
/dev/sdb2   2099200  69208063  67108864    32G Linux filesystem
/dev/sdb3  69208064 458328063 389120000 185.6G Linux filesystem

Disk /dev/mapper/steven: 185.6 GiB, 199227342848 bytes, 389115904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdc: 7.4 GiB, 7902068736 bytes, 15433728 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
Disklabel type: dos
Disk identifier: 0xd6ce0480

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 15433727 15431680  7.4G  c W95 FAT32 (LBA)

$ /bin/fdisk -l /dev/sdc

Disk /dev/sdc: 7.4 GiB, 7902068736 bytes, 15433728 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
Disklabel type: dos
Disk identifier: 0xd6ce0480

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 15433727 15431680  7.4G  c W95 FAT32 (LBA)

$ fdisk -l /dev/sdc

Disk /dev/sdc: 7.4 GiB, 7902068736 bytes, 15433728 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
Disklabel type: dos
Disk identifier: 0xd6ce0480

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 15433727 15431680  7.4G  c W95 FAT32 (LBA)

$ fdisk -l /dev/mapper/steven

Disk /dev/mapper/steven: 185.6 GiB, 199227342848 bytes, 389115904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
$ 

fdisk fails to list devices when there is an empty cdrom

# fdisk -l
fdisk: cannot open /dev/hdb: No medium found
# fdisk --version
fdisk from util-linux 2.25

I believe that the proper behaviour is to report the error and continue listing.
If you agree on that, I can prepare a patch.

exFAT superblock not probed

After commit 37f4060225df0591ab8e1dd676dbc8115d900d4f, exFAT filesystem is not probed by blkid.

commit 37f4060225df0591ab8e1dd676dbc8115d900d4f
Author: Hannes Reinecke <[email protected]>
Date:   Thu Mar 20 11:03:50 2014 +0100

    blkid: convert superblocks to new calling convention

    With the previous patch the scanning functions were
    modified to return a differentiated return code.
    To correctly abort scanning when an I/O error occurs
    we need to differentiate between 'error' (= -1) and
    'not found' (= 1) in the probe functions.
    This patch updates all superblock scanning functions
    to the new calling convention.

    Signed-off-by: Hannes Reinecke <[email protected]>
    Signed-off-by: Karel Zak <[email protected]>

When I revert some code, it probes exFAT disk properly like:

$ blkid
/dev/sdd1: UUID="3402-0CBC" TYPE="exfat" PARTUUID="be580595-01" 

Following is my patch.

From 68dec3b54fc1538a0048caf8cc2df9d4f9ae07b1 Mon Sep 17 00:00:00 2001
From: Sunjin Yang <[email protected]>
Date: Fri, 5 Sep 2014 14:32:26 +0900
Subject: [PATCH] blkid: fix exFAT superblock not probed

---
 libblkid/src/superblocks/exfat.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c
index b526560..b1173b8 100644
--- a/libblkid/src/superblocks/exfat.c
+++ b/libblkid/src/superblocks/exfat.c
@@ -121,8 +121,6 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
    if (label)
        blkid_probe_set_utf8label(pr, label->name,
                min(label->length * 2, 30), BLKID_ENC_UTF16LE);
-   else if (errno)
-       return -errno;

    blkid_probe_sprintf_uuid(pr, sb->volume_serial, 4,
            "%02hhX%02hhX-%02hhX%02hhX",
-- 
2.1.0

I don't know that this is a correct patch, but it works.

Any suggestion or idea?

fdisk partition entry description "W95 FAT32 (LBA)" is very misguiding

I've got a partition table here which has the following layout:

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: .....

Device Boot Start End Blocks Id System
/dev/sda1 * 63 4097519 2048728+ 7 HPFS/NTFS/exFAT
/dev/sda2 4097520 15755039 5828760 f W95 Ext'd (LBA)
/dev/sda5 4097583 6138719 1020568+ 7 HPFS/NTFS/exFAT
/dev/sda6 6138783 15755039 4808128+ 7 HPFS/NTFS/exFAT

Command (m for help): x

Expert command (m for help): p

Disk /dev/sda: 240 heads, 63 sectors, 1042 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 80 1 1 0 239 63 270 63 4097457 07
2 00 0 1 271 239 63 1023 4097520 11657520 0f
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00
5 00 1 1 271 239 63 405 63 2041137 07
6 00 1 1 406 239 63 1023 63 9616257 07

Expert command (m for help):

The 239 heads end values clearly point at an Extended CHS (ECHS) geometry
(A 16 heads divisor as registered on BIOS side gets translated to OS-side 240 heads),
whereas the 0x0f Extended Partition type gets labelled as a terribly non-precise "(LBA)" string.
This is very confusing since it suggests a partition table setup mismatch (ECHS-geometry entries, yet "LBA-type" Extended Partition), which actually does not seem to be the case here when evaluating the actual meaning of these types:

Original reference (hello Francois! :):
"(c)fdisk does not understand new Windows partition types" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=21779
where the original entries got created as "... (LBA)" despite winioctl.h clearly mentioning

define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses

extended int13 services
where I'd expect those EDD services to be about covering both LBA AND ECHS format.

I'd thereby strongly suggest renaming all such entries in fdisks/dos_part_types.h into "... (LBA/ECHS)" or "... (EDD)".

While renaming the descriptions into "... (EDD)" would be more precise/desireable since it reveals the actual intention behind these new entries (namely about them being merely about the EDD specification proper rather than a specific implementation of that - LBA or ECHS), renaming into "... (LBA/ECHS)" would have a different benefit: it would be able to preserve string matching for people who script-parsed things as "W95.*".

Hmm, some internet research seems to hint that ECHS translation calculation mechanism efforts probably predate the "Int 13h extensions" (EDD), so perhaps ECHS geometry entries are usually expected to be using the old 0x05 ID instead, with 0x0f simply happening to also support it, due to "Int 13h extensions" being a clean superset of "Int 13h".
So this would mean that an "LBA/ECHS" string would be misguiding, and we should rather be choosing an "EDD" string, to correct that it's NOT an LBA-specific geometry but rather supporting LBA in addition to all other geometry mechanisms.

I'm definitely in favour of renaming it to something like "... (EDD)" since "LBA" is not a precise way to express this type (as can be witnessed by the entry in winioctl.h not even making any mention of "LBA" whatsoever, and many partition entry listing source examples on Internet not even mentioning "LBA" either), despite this possibly breaking some user scripts which happen to be parsing interactive command line programs (note that these partition entry descriptions have been changed before already, in df1dddf ).

Perhaps using "... (ExtInt13)" or "... (Int13Ext)" or "... (Int13Ex)" would be more obvious than a likely more unknown "EDD", but perhaps the entry length would then be too big (since the previous description changes were a shortening from Win95 to W95).

Also, the content in commit 7eda085 even admitted that it's mis-declaring things:

  •   {0x0c, N_("Win95 FAT32 (LBA)")},/\* LBA really is `Extended Int 13h' */
    

After libata's woefully hard-coded HDIO_GETGEO ioctl .getgeo callback "helpfully" "pretending" that all disks have a 255/63 LBA geometry (ntfsfixboot - NOT! wasted days on this mess...) and the mis-labeling of entries here, you could say that I'm on a rampage to getting geometry-related things to be declared correctly.....

Thanks!

cfdisk partition offset

cfdisk doesnt have an option to change the starting sector.

my disk keeps saying 63 & wont let grub install to the disk. fdisk does this, but is unreasonable to use.

[util-linux 2.21+][losetup] losetup -f can't find free loop if first 8 loops used

After updating from util-linux 2.20 to util-linux 2.21 I experienced error
losetup: find unused loop device failed: No such file or directory
when executing losetup -f
There are /dev/loop/ directory with 128 symbolic links to 128 loop devices in /dev/ in my system.
I compared code from 2.20 mount/lomount.c/name2minor

n = strtol(name, &end, 10);
if (end && end != name && *end == '\0' && n >= 0)
    return n;

and 2.21 lib/loopdev.c/loop_scandir

n = strtol(d->d_name, &end, 10);
if (d->d_name == end || (end && *end) || errno)
    continue;

and found, that errno was setted to 2 before executing strtol, but strtol not resetting errno in "no error" case.
So I added setting errno to 0 before strtol call and my issue was resolved.

same option appears twice in ./configure --help

Just a very minor appearance issue:

...
...
Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR
                        (or the compiler's sysroot if not specified).
  --with-html-dir=PATH    path to installed docs
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
...
...

The --with-gnu-ld line shows up twice!

uuidgen --random is not recognised

The --random option, in contrast to --time, is not recognised
by uuidgen despite being documented both in the --help and
in the manpage.

gettext 0.18.2

Is there a specific reason for gettext 0.18.2? I'm building on Ubuntu 13.10 and I have gettext 0.18.1. Everything builds and tests fine... Would the following change be welcome?

$ git diff
diff --git a/configure.ac b/configure.ac
index 70df7ff..d8926af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,7 +152,7 @@ UL_SET_ARCH([HPPA], [hppa*])

AC_SYS_LARGEFILE

-AM_GNU_GETTEXT_VERSION([0.18.2])
+AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])

AS_IF([test -d "$srcdir/po"], [

$ make check

[snip]

All 137 tests PASSED

centos 6.4

[tx@phone util-linux-2.24]$ cat /etc/redhat-release
CentOS release 6.4 (Final)
[tx@phone util-linux-2.24]$ uname -a
Linux phone 3.10.54-1.el6.elrepo.x86_64 #1 SMP Sat Sep 6 12:44:02 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
configure: WARNING: Unable to detect syscall setns.
configure: error: nsenter selected but setns syscall not found

If this centos don't support namespace, how to solve it?

blkid no longer detects exfat

I upgraded to util-linux-2.25.1 and exfat is longer detected with blkid or lsblk. Simply reverting to util-linux-2.24.2 fixes the issue. Let me know if you need any more information.

[util-linux 2.24] mnt_resolve_path() is doing it wrong

Hello.

I'm trying to mount /dev/dm-1 to /mnt/dm-1 using the following command:

mount /dev/dm-1 /mnt/dm-1

The output of the command above states that "mount point /dev/mapper/home-root is not a directory". I turn on debugging and get the following piece of information:

6020: libmount:      CXT: [0x169b030]: preparing source path
6020: libmount:      CXT: [0x169b030]: srcpath '/dev/dm-1'
6020: libmount:    CACHE: [0x169b290]: alloc
6020: libmount:    CACHE: [0x169b290]: add entry [ 1] (path): /dev/mapper/home-root: /dev/dm-1
6020: libmount:      CXT: [0x169b030]: final srcpath '/dev/mapper/home-root'
6020: libmount:      CXT: [0x169b030]: preparing target path
6020: libmount:    CACHE: [0x169b290]: add entry [ 2] (path): /dev/mapper/home-root: /mnt/dm-1/
6020: libmount:      CXT: [0x169b030]: final target '/dev/mapper/home-root'
6020: libmount:    CACHE: [0x169b290]: get /dev/mapper/home-root FS type
6020: libmount:    CACHE: [0x169b290]: tags for /dev/mapper/home-root requested
6020: libmount:    CACHE: [0x169b290]: reading tags for: /dev/mapper/home-root
6020: libmount:    CACHE: [0x169b290]: add entry [ 3] (tag): /dev/mapper/home-root: UUID
6020: libmount:    CACHE: [0x169b290]: add entry [ 4] (tag): /dev/mapper/home-root: TYPE
6020: libmount:    CACHE: [0x169b290]:  read 2 tags
6020: libmount:      CXT: [0x169b030]: FS type: ext4 [rc=0]
6020: libmount:      CXT: [0x169b030]: /sbin/mount.ext4          ... not found
6020: libmount:      CXT: [0x169b030]: /sbin/fs.d/mount.ext4     ... not found
6020: libmount:      CXT: [0x169b030]: /sbin/fs/mount.ext4       ... not found
6020: libmount:      CXT: [0x169b030]: prepare update
6020: libmount:   UPDATE: [0x169e270]: allocate
6020: libmount:   UPDATE: [0x169e270]: resetting FS [fs=0x0x169b130, target=(null), flags=0x00000000]
6020: libmount:   UPDATE: [0x169e270]: FS template:
6020: libmount:   UPDATE: ------ fs: 0x169b130
source: /dev/mapper/home-root
target: /dev/mapper/home-root

As I can see, libmount resolved "/mnt/dm-1" to "/dev/mapper/home-root". This happens because of the following code in function canonicalize_path():

        if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
                char *dm = canonicalize_dm_name(p + 1);
                if (dm) {
                        free(canonical);
                        return dm;
                }
        }

I guess something should be changed, because mountpoints are not block devices.

compilation problems on uclibc

I tried compiling agetty under uclibc and it fails.

When compiling lib/colors.c, it fails because of missing
support for UL_SCNsA.

When compiling agetty.c it fails because of unsupported
futimes() (uclibc has futimens() instead).

I believe it should be easy to add the autoconf checks
for this.

blkid doesn't see udf label

I have a UDF partition that was formatted in Windows. blkid doesn't seem to see the label of it.

I think this is because windows uses the logical volume ident and blkid uses the volume ident.

It would be nice to see this fixed, since I'm getting tired of seeing it mounted as /media/disk

Here is a 10Mb diskimage with a udf partition formatted in windows that can be used for tests, http://miffe.org/~miffe/tmp/winudf.img.gz

mount ignores encryption option

According to mount manpage, mount supposed to support the encryption option, to set up cryptoloop devices through losetup. The following command

mount -o loop,encryption=twofish test.img /mnt

asks for a password, then mount the loopdisk if the password is correct, otherwise bail out with 'you must specify the filesystem type' under util-linux-2.20.1. In 2.21.1 (and 2.21.2) this command immediately print that error message, it don't ask for a password.

After a quick look in mount.c (but I'm not familiar with the codebase, so I could be wrong) it looks like the encryption option is stored into variable, once checked if exists, but never read actually. In 2.20.1 there was a set_loop call that probably take care of this.

reiserfs mount fails for read-only devices

You cannot mount read-only devices such as write protected SD cards, CD-ROMs, etc. with reiserfs. This is currently being detected by the udisks2 test suite which tries to do fs creation and mounting for r/w and r/o devices.

If you want to reproduce this on Linux without any hardware, here are the steps (as root) to prepare a virtual readonly device:

modprobe scsi_debug dev_size_mb=100

now check dmesg for the device that it created; usually /dev/sdb

mkfs.reiserfs -f -l testro /dev/sdb

now create a readonly CD-ROM like device:

echo 5 > /sys/bus/pseudo/drivers/scsi_debug/ptype
echo 1 > /sys/bus/pseudo/drivers/scsi_debug/add_host

now check dmesg for the created CD-ROM device, usually /dev/sr1

try to mount it:

mount  /dev/sr1 /mnt

This gives:

mount /dev/sr1  /mnt
mount: /dev/sr1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sr1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so

Explicitly specifying -r (readonly) also doesn't help; the first line disappears, but the "can't read superblock" error is still happening.

dmesg says:

[30800.648134] REISERFS (device sr1): found reiserfs format "3.6" with standard journal
[30800.648154] REISERFS (device sr1): using ordered data mode
[30800.648156] reiserfs: using flush barriers
[30800.668158] REISERFS warning (device sr1): sh-458 journal_init_dev: cannot init journal device 'unknown-block(11,1)': -30
[30800.668163] REISERFS warning (device sr1): sh-462 journal_init: unable to initialize jornal device
[30800.668185] REISERFS warning (device sr1): sh-2022 reiserfs_fill_super: unable to initialize journal space

If reiserfs is not meant to work on read-only devices, please feel free to close this issue as "wontfix".

Tested with a rather old 2.20.1, and confirmed with current git master.

Please feel free to close

Please add hard disk serial number output to lsblk

I use lsblk to get disk information for all my new scripts in Parted Magic. The only information that's missing is the serial number for the disk. Other than that, all useful information can be obtained with this one program. I am very impressed with lsblk and what it can do. Keep up the great work.

xfs mount fails for read-only devices

You cannot mount read-only devices such as write protected SD cards, CD-ROMs, etc. with XFS. This is currently being detected by the udisks2 test suite which tries to do fs creation and mounting for r/w and r/o devices.

If you want to reproduce this on Linux without any hardware, here are the steps (as root) to prepare a virtual readonly device:

modprobe scsi_debug dev_size_mb=100

now check dmesg for the device that it created; usually /dev/sdb

mkfs.xfs -L testro /dev/sdb

now create a readonly CD-ROM like device:

echo 5 > /sys/bus/pseudo/drivers/scsi_debug/ptype
echo 1 > /sys/bus/pseudo/drivers/scsi_debug/add_host

now check dmesg for the created CD-ROM device, usually /dev/sr1

try to mount it:

mount -t xfs /dev/sr1 /mnt

This gives:

mount: block device /dev/sr1 is write-protected, mounting read-only
mount: /dev/sr1: can't read superblock

Explicitly specifying -r (readonly) also doesn't help; the first line disappears, but the "can't read superblock" error is still happening.

Tested with a rather old 2.20.1, and confirmed with current git master.

umount passes “-t fuse” to umount.davfs, davfs exits with error

Using the following versions:

util-linux 2.25-3
davfs2 1.5.0-1
3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux 

When trying to unmount a davfs filesystem through umount, umount tries passing a “-t fuse” flag to umount.davfs, causing it fail because it does not recognize that option.

Here is a full report on what's happening:

% env LIBMOUNT_DEBUG=0xffff umount box.com              
16433: libmount:     INIT: library debug mask: 0xffff
16433: libmount:     INIT: library version: 2.25.0
16433: libmount:     INIT:     feature: assert
16433: libmount:     INIT:     feature: debug
16433: libmount:      CXT: [0x1de3110]: ----> allocate [RESTRICTED]
16433: libmount:      CXT: [0x1de3110]: umount: /home/janis/box.com
16433: libmount:      CXT: [0x1de3110]: umount: lookup FS for '/home/janis/box.com'
16433: libmount:      CXT: [0x1de3110]: checking for writable tab files
16433: libmount:    UTILS: mtab: /etc/mtab
16433: libmount:    UTILS: /etc/mtab: irregular/non-writable
16433: libmount:    UTILS: utab: /run/mount/utab
16433: libmount:    CACHE: [0x1de4320]: alloc
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /home/janis/box.com
16433: libmount:    CACHE: [0x1de4320]: add entry [ 1] (path): /home/janis/box.com: /home/janis/box.com
16433: libmount:      CXT: [0x1de3110]: tabfilter ENABLED!
16433: libmount:      TAB: [0x1de5f80]: alloc
16433: libmount:      TAB: [0x1de5f80]: set table parser filter
16433: libmount:    UTILS: mtab: /etc/mtab
16433: libmount:    UTILS: /etc/mtab: irregular/non-writable
16433: libmount:      TAB: [0x1de5f80]: /proc/self/mountinfo: start parsing [entries=0, filter=yes]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:      TAB: [0x1de5f80]: add entry: https://dav.box.com/dav /home/janis/box.com
16433: libmount:    CACHE: canonicalize path /proc/self/mountinfo
16433: libmount:      TAB: TID for /proc/self/mountinfo is 16433
16433: libmount:       FS: [0x1de6300]: free [refcount=0]
16433: libmount:      TAB: [0x1de5f80]: /proc/self/mountinfo: stop parsing (1 entries)
16433: libmount:      TAB: [0x1de6300]: alloc
16433: libmount:      TAB: [0x1de6300]: set table parser filter
16433: libmount:      TAB: [0x1de6300]: /run/mount/utab: start parsing [entries=0, filter=yes]
16433: libmount:      TAB: [0x1de6300]: add entry: https://dav.box.com/dav /home/janis/box.com
16433: libmount:       FS: [0x1de6470]: free [refcount=0]
16433: libmount:      TAB: [0x1de6300]: /run/mount/utab: stop parsing (1 entries)
16433: libmount:      TAB: [0x1de5f80]: merging user fs
16433: libmount:      TAB: [0x1de5f80]: found fs -- appending user optstr
16433: libmount:      TAB: [0x1de5f80]: found fs:
16433: libmount:      TAB: ------ fs: 0x1de6220
source: https://dav.box.com/dav
target: /home/janis/box.com
fstype: fuse
optstr: rw,nosuid,nodev,noexec,relatime,user_id=1000,group_id=100,allow_other,max_read=16384,uid=1000,gid=100,user=janis,helper=davfs
VFS-optstr: rw,nosuid,nodev,noexec,relatime
FS-opstr: rw,user_id=1000,group_id=100,allow_other,max_read=16384,uid=1000,gid=100
user-optstr: user=janis,helper=davfs
optional-fields: 'shared:65'
root:   /
id:     114
parent: 70
devno:  0:37
tid:    16433
16433: libmount:      TAB: [0x1de6300]: reset
16433: libmount:       FS: [0x1de6360]: free [refcount=0]
16433: libmount:      TAB: [0x1de6300]: free [refcount=0]
16433: libmount:      CXT: [0x1de3110]: mtab requested [nents=1]
16433: libmount:      TAB: [0x1de5f80]: unset table parser filter
16433: libmount:      CXT: [0x1de3110]: tabfilter disabled
16433: libmount:      TAB: [0x1de5f80]: lookup TARGET: '/home/janis/box.com'
16433: libmount:      CXT: [0x1de3110]: umount fs: /home/janis/box.com
16433: libmount:      CXT: [0x1de3110]: umount: mtab applied
16433: libmount:      CXT: [0x1de3110]: merging mount flags
16433: libmount:      CXT: [0x1de3110]: final flags: VFS=0020000e user=00001008
16433: libmount:      CXT: [0x1de3110]: umount: evaluating permissions
16433: libmount:      TAB: [0x1de6060]: alloc
16433: libmount:      TAB: [0x1de6060]: /etc/fstab: start parsing [entries=0, filter=not]
16433: libmount:      TAB: [0x1de6060]: add entry: tmpfs /tmp
16433: libmount:      TAB: [0x1de6060]: add entry: /dev/sda2 /
16433: libmount:      TAB: [0x1de6060]: add entry: /dev/sda1 /boot
16433: libmount:      TAB: [0x1de6060]: add entry: /dev/sda3 /var
16433: libmount:      TAB: [0x1de6060]: add entry: /dev/sda4 /home
16433: libmount:      TAB: [0x1de6060]: add entry: https://dav.box.com/dav /home/janis/box.com
16433: libmount:       FS: [0x1de60c0]: free [refcount=0]
16433: libmount:      TAB: [0x1de6060]: /etc/fstab: stop parsing (6 entries)
16433: libmount:      TAB: [0x1de6060]: lookup SOURCE: https://dav.box.com/dav TARGET: /home/janis/box.com
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /tmp
16433: libmount:    CACHE: [0x1de4320]: add entry [ 2] (path): /tmp: /tmp
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /
16433: libmount:    CACHE: [0x1de4320]: add entry [ 3] (path): /: /
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /boot
16433: libmount:    CACHE: [0x1de4320]: add entry [ 4] (path): /boot: /boot
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /var
16433: libmount:    CACHE: [0x1de4320]: add entry [ 5] (path): /var: /var
16433: libmount:    CACHE: [0x1de4320]: canonicalize path /home
16433: libmount:    CACHE: [0x1de4320]: add entry [ 6] (path): /home: /home
16433: libmount:      CXT: [0x1de3110]: umount: checking user=<username> from mtab
16433: libmount:      CXT: [0x1de3110]: umount /home/janis/box.com is allowed
16433: libmount:      CXT: [0x1de3110]: umount: umount.davfs helper requested
16433: libmount:      CXT: [0x1de3110]: /sbin/umount.davfs        ... found
16433: libmount:      CXT: [0x1de3110]: prepare update
16433: libmount:   UPDATE: [0x1de6890]: allocate
16433: libmount:   UPDATE: [0x1de6890]: resetting FS [fs=0x(nil), target=/home/janis/box.com, flags=0x0020000e]
16433: libmount:   UPDATE: [0x1de6890]: ready
16434: libmount:      CXT: [0x1de3110]: argv[0] = "/sbin/umount.davfs"
16434: libmount:      CXT: [0x1de3110]: argv[1] = "/home/janis/box.com"
16434: libmount:      CXT: [0x1de3110]: argv[2] = "-t"
16434: libmount:      CXT: [0x1de3110]: argv[3] = "fuse"
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments
16433: libmount:      CXT: [0x1de3110]: /sbin/umount.davfs executed [status=1]
16433: libmount:      CXT: [0x1de3110]: don't update: external helper
16433: libmount:      CXT: [0x1de3110]: <---- reset [status=1] ---->
16433: libmount:       FS: [0x1de4220]: free [refcount=0]
16433: libmount:      TAB: [0x1de5f80]: reset
16433: libmount:       FS: [0x1de6220]: free [refcount=0]
16433: libmount:      TAB: [0x1de5f80]: free [refcount=0]
16433: libmount:      CXT: [0x1de3110]: <---- reset [status=0] ---->
16433: libmount:      TAB: [0x1de6060]: reset
16433: libmount:       FS: [0x1de66b0]: free [refcount=0]
16433: libmount:       FS: [0x1de69b0]: free [refcount=0]
16433: libmount:       FS: [0x1de6c90]: free [refcount=0]
16433: libmount:       FS: [0x1de6f50]: free [refcount=0]
16433: libmount:       FS: [0x1de7230]: free [refcount=0]
16433: libmount:       FS: [0x1de7510]: free [refcount=0]
16433: libmount:      TAB: [0x1de6060]: free [refcount=0]
16433: libmount:    CACHE: [0x1de4320]: free [refcount=0]
16433: libmount:   UPDATE: [0x1de6890]: free
16433: libmount:      CXT: [0x1de3110]: <---- free
zsh: exit 1     env LIBMOUNT_DEBUG=0xffff umount box.com

Note this part (taken from above):

16433: libmount:      CXT: [0x1de3110]: umount: umount.davfs helper requested
16433: libmount:      CXT: [0x1de3110]: /sbin/umount.davfs        ... found
16433: libmount:      CXT: [0x1de3110]: prepare update
16433: libmount:   UPDATE: [0x1de6890]: allocate
16433: libmount:   UPDATE: [0x1de6890]: resetting FS [fs=0x(nil), target=/home/janis/box.com, flags=0x0020000e]
16433: libmount:   UPDATE: [0x1de6890]: ready
16434: libmount:      CXT: [0x1de3110]: argv[0] = "/sbin/umount.davfs"
16434: libmount:      CXT: [0x1de3110]: argv[1] = "/home/janis/box.com"
16434: libmount:      CXT: [0x1de3110]: argv[2] = "-t"
16434: libmount:      CXT: [0x1de3110]: argv[3] = "fuse"
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments
16433: libmount:      CXT: [0x1de3110]: /sbin/umount.davfs executed [status=1]

umount detects that umount.davfs is needed and calls it, but for whatever reason it tries passing -t fuse to it, causing it to fail. If you look at umount_davfs.c you will note that umount.davfs does not know about that option and hence fails.

Resolution: Do not pass -t fuse to umount.davfs.

EDIT: In case this is of interest, I verified the above mounting and unmounting as root only:

# mount -t davfs https://path.to.remote /mnt/local
# umount /mnt/local
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments

dmesg -T -f file doesn't show time

dmesg -T --file file should show parsed time - it doesn't do that:

[root@farm ~]# dmesg -T --file /var/log/dmesg | head -n 5
[Mon Dec 17 07:46:44 2012] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.7.0-0.1 (arekm@carme-pld-i686) (gcc version 4.7.2 20121104 (release) (PLD-Linux) ) #1 SMP Fri Dec 14 11:30:44 CET 2012
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009f7ff] usable

[root@farm ~]# dmesg --version
dmesg from util-linux 2.22.2

fdisk: build fails on IA32 architectures

fdisk fails for for all tested arch/cpu types emitting following error:

In file included from fdiskbsdlabel.c:62:0:
fdiskbsdlabel.h:61:2: error: #error unknown architecture
fdiskbsdlabel.c: In function 'bselect':
fdiskbsdlabel.c:180:44: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:180:44: note: each undeclared identifier is reported only once for each function it appears in
fdiskbsdlabel.c: In function 'xbsd_write_bootstrap':
fdiskbsdlabel.c:539:24: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_readlabel':
fdiskbsdlabel.c:744:28: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:744:60: error: 'BSD_LABELOFFSET' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_writelabel':
fdiskbsdlabel.c:769:32: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:780:61: error: 'BSD_LABELOFFSET' undeclared (first use in this function)

make[2]: *** [fdisk-fdiskbsdlabel.o] Error 1

Tested architectures:

  • i486 using gcc -march=i486
  • i586 using gcc -march=pentium-mmx
  • i686 using gcc -march={pentiumpro,pentium2,pentium3,pentium-m,pentium4}

Tested with following major toolchain components:

binutils 2.21.53.0.2
gcc 4.6.2
glibc 2.14.1

mount -o remount always appends options to /etc/mtab even if they already exist

If you use mount -o remount,, these extra options always get appended to the existing ones in /etc/mtab. This has the effect that on suspend/resume, mounted USB drives keep growing options like

/dev/sdc1 on /media/LaCie type ext4 (rw,nosuid,nodev,commit=600,commit=600,commit=0,commit=600,commit=0,commit=600,commit=0,commit=0,commit=0,commit=600,commit=0,commit=0,commit=600,commit=0,commit=600,commit=600,commit=0,uhelper=udisks)

because of a pm-utils hook (/usr/lib/pm-utils/power.d/journal-commit).

Reproducer:

$ sudo modprobe scsi_debug

ATTENTION! MAKE TRIPLE-SURE ABOUT THE DEVICE NAME HERE! it's the fake one from scsi_debug

$ sudo mkfs.ext4 /dev/sdb
$ sudo mount /dev/sdb /mnt
$ grep sdb /etc/mtab
/dev/sdb /mnt ext4 rw 0 0

$ sudo mount -o remount,commit=600 /dev/sdb
$ grep sdb /etc/mtab
/dev/sdb /mnt ext4 rw,commit=600 0 0

$ sudo mount -o remount,commit=600 /dev/sdb
$ grep sdb /etc/mtab
/dev/sdb /mnt ext4 rw,commit=600,commit=600 0 0

mount success messages go to stderr

On successful mount a message like this is displayed
mount: /dev/sdb1 mounted on /mnt/hdd
I see this as a success message but when I redirected both stdout and stderr to files, all messages resided in the stderr file.

$ mount -v /mnt/hdd/ 1>outfile 2>errfile
$ cat outfile
$ cat errfile
mount: /dev/sdb1 mounted on /mnt/hdd

I'm not sure if this was the intention because the message seems to be a success message and with --verbose on it should go to stdout. I checked mount.c and found this message to be in success_message() and printed via this line

warnx(_("%s mounted on %s"), src, tgt);

I am not at all familiar with the code base and the philosophy that is why I'm telling you here :)

Thank you!

2.25 regression: cfdisk build error with reentrant ncurses

If ncurses is build with --enable-reentrant, building util-linux-2.25.1 fails with the folllowing error:

disk-utils/cfdisk.c: In function 'resize':
disk-utils/cfdisk.c:202:9: error: lvalue required as left operand of assignment
   LINES = ws.ws_row;
         ^
disk-utils/cfdisk.c:203:8: error: lvalue required as left operand of assignment
   COLS = ws.ws_col;
        ^

man COLS gives the following:

Depending on the configuration, these may be actual variables,
or macros (see curs_threads(3X)) which provide read-only
access to curses's state.  In either case, applications should
treat them as read-only to avoid confusing the library.

cfdisk: Compile Fails

Normal:

./autogen.sh
./configure
make

results in:

  CC     disk-utils/cfdisk-cfdisk.o
disk-utils/cfdisk.c: In function ‘ui_init’:
disk-utils/cfdisk.c:700:2: error: too few arguments to function ‘colors_init’
./include/colors.h:55:12: note: declared here

cfdisk: Compile Fails

Normal:

./autogen.sh
./configure
make

results in:

  CC     disk-utils/cfdisk-cfdisk.o
disk-utils/cfdisk.c: In function ‘ui_init’:
disk-utils/cfdisk.c:700:2: error: too few arguments to function ‘colors_init’
./include/colors.h:55:12: note: declared here

dmesg -T show different time for the same lines

dmesg -T shows different seconds for the same event. Note it's sometime 07 and sometimes 08 seconds.

[root@farm ~]# date; dmesg -T | tail -n 5
Mon Dec 17 12:49:14 CET 2012
[Mon Dec 17 12:01:07 2012] EAX: b66424a4 EBX: b6641ff4 ECX: 00000000 EDX: 00000038
[Mon Dec 17 12:01:07 2012] ESI: bf9fac94 EDI: 00000000 EBP: 08875bd8 ESP: bf9fac4c
[Mon Dec 17 12:01:07 2012] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[Mon Dec 17 12:01:07 2012] Process php (pid: 29682, ti=ef48c000 task=ef4a8cc0 task.ti=ef48c000)

[root@farm ~]# date; dmesg -T | tail -n 5
Mon Dec 17 12:49:15 CET 2012
[Mon Dec 17 12:01:08 2012] EAX: b66424a4 EBX: b6641ff4 ECX: 00000000 EDX: 00000038
[Mon Dec 17 12:01:08 2012] ESI: bf9fac94 EDI: 00000000 EBP: 08875bd8 ESP: bf9fac4c
[Mon Dec 17 12:01:08 2012] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[Mon Dec 17 12:01:08 2012] Process php (pid: 29682, ti=ef48c000 task=ef4a8cc0 task.ti=ef48c000)

[root@farm ~]# date; dmesg -T | tail -n 5
Mon Dec 17 12:49:15 CET 2012
[Mon Dec 17 12:01:07 2012] EAX: b66424a4 EBX: b6641ff4 ECX: 00000000 EDX: 00000038
[Mon Dec 17 12:01:07 2012] ESI: bf9fac94 EDI: 00000000 EBP: 08875bd8 ESP: bf9fac4c
[Mon Dec 17 12:01:07 2012] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[Mon Dec 17 12:01:07 2012] Process php (pid: 29682, ti=ef48c000 task=ef4a8cc0 task.ti=ef48c000)

[root@farm ~]# date; dmesg -T | tail -n 5
Mon Dec 17 12:49:15 CET 2012
[Mon Dec 17 12:01:07 2012] EAX: b66424a4 EBX: b6641ff4 ECX: 00000000 EDX: 00000038
[Mon Dec 17 12:01:07 2012] ESI: bf9fac94 EDI: 00000000 EBP: 08875bd8 ESP: bf9fac4c
[Mon Dec 17 12:01:07 2012] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[Mon Dec 17 12:01:07 2012] Process php (pid: 29682, ti=ef48c000 task=ef4a8cc0 task.ti=ef48c000)

[root@farm ~]# dmesg --version
dmesg from util-linux 2.22.2

man page says: "The timestamp could be inaccurate!" but I assume it means that the date shown isn't exactly the date when event happened and not that timestamp will differ for different dmesg -T invocations.

namei shows no information when invalid symlink is found

namei is a great tool for debugging complex paths, especially when symbolic links are involved. However, if the symbolic link is invalid, namei shows no information instead of partial:

Example 1:

$ ln -s /usr/local/does/not/exist /tmp/space
$ ls -lad /tmp/space
lrwxrwxrwx 1 tlim eng 25 2012-01-29 11:03 /tmp/space -> /usr/local/does/not/exist
$ namei /tmp/space
namei: failed to stat: /tmp/space: No such file or directory

Desired output:

f: /tmp/space
d /
d tmp
l space -> /usr/local/does/not/exist
d /
d usr
does ERROR: No such file or directory.

This was discovered when debugging the following problem: "mkdir -p /the/dir/path" was giving a strange error: "Cannot create directory `/the/dir': File exists". The obvious debugging tool was namei, but "namei /the/dir/path" failed to start because /the/dir/path did not exist.

Compile Requires gettext

You need gettext installed to make, but nothing warns you about this. Probably ./configure should warn if gettext is not detected.

mount --no-canonicalize not honored for tmpfs

If you do /bin/mount --no-canonicalize /foo then /bin/mount will call /sbin/mount.tmpfs without the --no-canonicalize option, and then /sbin/mount.tmpfs will call /bin/mount -i $@ ... which means the --no-canonicalize then gets lost and /bin/mount canonicalizes.

no option to change "usrsbin_execdir"

The current Makefile puts 9 files in /usr/sbin, with no option to change it (that I can see anyway!). It won't let me use something like --usrsbin-execdir=/usr/bin , I did try that though.

Configure:

./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/bin --libdir=/usr/lib \
--localstatedir=/run --enable-fs-paths-extra=/usr/bin --disable-makeinstall-chown
...
...
...
    util-linux  2.25

    prefix:            /usr
    exec prefix:       ${prefix}

    localstatedir:     /run
    bindir:            /usr/bin
    sbindir:           /usr/bin
    libdir:            /usr/lib
    includedir:        ${prefix}/include
    usrbin_execdir:    ${exec_prefix}/bin
    usrsbin_execdir:   ${exec_prefix}/sbin
    usrlib_execdir:    /usr/lib
...
...

Result (showing the programs that are installed here)

    ├── sbin
    │   ├── addpart
    │   ├── delpart
    │   ├── fdformat
    │   ├── ldattach
    │   ├── partx
    │   ├── readprofile
    │   ├── resizepart
    │   ├── rtcwake
    │   └── uuidd

integer overflow in ipcs.c, do_shm()

/proc/sys/kernel/shmall gives a count of pages as size_t. This overflows when multiplying by pagesize:

ipc_print_size(unit == IPC_UNIT_DEFAULT ? IPC_UNIT_KB : unit,
               _("max total shared memory"),
               lim.shmall * getpagesize(), "\n", 0);

That's why ./tests/ts/ipcs/limits2 fails on systems where shmall is large enough.
The problem got a bit worse since 56692a6.

Don't know how this should be fixed. I guess the only real fix would be to use large integer arithmetics.

tests, fdisk/sunlabel trailing white spaces

fdisk/sunlabel test fails because ae0abae or a616189 added some trailing white spaces to the output (in table rows where last column is empty).
Don't know whether these trailing whites paces are intended or not. Would be nice to check that and either to fix it or to update expected test output.

using umount with bash wildcard ends in "device is busy" for mount of parent directory

hi,

i'm not sure if this problem is related to util-linux/mount, kernel or ubuntu specific.

i've opened a bug report for ubuntu too.

heres the link: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1358310

i've run into a problem on ubuntu 14.04 while mounting an ganeti instance for doing some chroot stuff. but the problem itself not related to ganeti or any other virtualization. its just a problem while mounting/unmounting some devices.

so heres an example how to reproduce the problem:

lvcreate -L 1G -n test system
lvcreate -L 1G -n test2 system
mkfs.ext4 /dev/system/test
mkfs.ext4 /dev/system/test2
mount /dev/system/test /mnt/
mkdir /mnt/test2
mount /dev/system/test2 /mnt/test2/
ln -sf /etc/issue /mnt/
umount /mnt/*
umount /mnt/
lvremove -f /dev/system/test2
lvremove -f /dev/system/test

if i run this commands /mnt/ is still mounted and it is only possible to umount it using "-l" switch. but after this it is still not possible to remove the logical volume because it says "Logical volume system/test contains a filesystem in use."

if i run the same commands but without the "ln -sf /etc/issue /mnt/" everything is okay. also if i replace "umount /mnt/*" with "umount /mnt/boot" everything works.

so it seems like umount ist opening /etc/issue for some reason if a bash wildcard is used and not releasing it. checking with lsof or fuser does not show any open files under /mnt/ nor for /etc/issue.

the problem does not exist with ubuntu 12.04.

a solution for this problem would be great because if you often do some chroot stuff it is easier to use "umount /mnt/*" to umount all bind mounts like /proc/ or /sys/ than running a umount command for each mount.

also i havent found a way, other than reboot, to remove an open logical volume if it was hit by this problem.

lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04

regards
the2nd

scriptreplay: Skips output recorded by `script` command

I am not sure if there is a bug within the script command when it outputs timing information, or if this bug is solely with scriptreplay.

Based on the code on lines 235-237 in scriptreplay.c (https://github.com/karelzak/util-linux/blob/7f1d48363823f7da47ca56f84eb4b2155c5ed36b/term-utils/scriptreplay.c#L235) which is inside the loop replaying data, the very last line of the timing file is never properly consumed. The bytes it associates with are never output.

I confirmed this behavior by recording a session with script -ttest.time, replaying with scriptreplay -ttest.time > test.scriptreplay and examining the resultant file with vimdiff test.scriptreplay typescript.

I noticed that the last bytes of the typescript file are not output by scriptreplay.

This is very odd behavior.

In addition, I noticed that the timing values output in test.time by script do not match up with the recorded session bytes properly---they appear off-by-one in the temporal sense.

So what this means is that the odd "first line time skip" by scriptreplay matches up the timeline properly, but the last few bytes in the typescript file are never replayed because of this.

This is subtle, but for tools trying to parse script output, this is a strange thing to handle.

An option to make autologin quiet

Hi, I'm trying to have an absolutely silent boot:
https://wiki.archlinux.org/index.php/Silent_boot

However I find agetty printing with the configuration:

ExecStart=-/sbin/agetty -i -a hendry %I 38400

The following:

hostname login: hendry (automatic login)

Which is undesirable. I thought initially -n, --skip-login might help, but it doesn't after testing and looking at the source. Thanks!

libmount: wrong build dependency when compiling with selinux support

When building with selinux support on gentoo, make complains about not knowing how to create -L/usr/lib. The relevant parts of the Makefile are:

libmount.la: $(libmount_la_OBJECTS) $(libmount_la_DEPENDENCIES) $(EXTRA_libmount_la_DEPENDENCIES)
        $(AM_V_CCLD)$(libmount_la_LINK) $(am_libmount_la_rpath)  $(libmount_la_OBJECTS) $(libmount_la_LIBADD) $(LIBS)

libmount_la_DEPENDENCIES = \
        $(libmount_la_LIBADD) \
        libmount/src/libmount.sym \
        libmount/src/libmount.h.in

libmount_la_LIBADD = libcommon.la libblkid.la $(SELINUX_LIBS)

SELINUX_LIBS is set to "-L/usr/lib -lselinux", set via "pkg-config --libs libselinux" in the configure script.

Thus, -L/usr/lib is listed as a build-time dependency. SELINUX_LIBS shouldn't be included in libmount_la_DEPENDENCIES.

The following change makes the whole package build for me:

--- libmount/src/Makemodule.am.orig 2014-02-26 17:16:40.616350361 +0100
+++ libmount/src/Makemodule.am  2014-02-26 17:48:05.442935432 +0100
@@ -39,7 +39,7 @@
    -I$(top_srcdir)/libmount/src

 libmount_la_DEPENDENCIES = \
-   $(libmount_la_LIBADD) \
+   libcommon.la libblkid.la \
    libmount/src/libmount.sym \
    libmount/src/libmount.h.in

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.