summaryrefslogtreecommitdiff
path: root/mount
AgeCommit message (Collapse)AuthorFilesLines
2011-01-31Merge remote branch 'origin/master'LaMont Jones10-78/+344
Conflicts: mount/mount.8 mount/mount.c
2011-01-31mount: fix parsing offset= followed by more optionsPetr Uzel4-25/+29
mount does not parse parse offset= option if it is followed by other options. In umount, the parsing is done with the get_value() function. This patch moves get_value to fstab.c (with new name get_option_value()) and fixes mount to use the function. [kzak@redhat.com: - rename to get_option_value() - use fstab.c rather than sundries.c] Novell bugzilla: #666150 Reported-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-31swapon: make needlessly global variables staticTobias Klauser1-9/+9
Also constify the option array. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2011-01-27mount: fix atime description in mount.8 man pageKarel Zak1-2/+5
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=665376 Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-22libmount: cleanup API, remove typedefKarel Zak4-17/+17
- replace mnt_ with libmnt_ prefix for types (the old prefix was too generic) - remove typedef, use struct everywhere - use shorter functions names (s/userspace/user/; s/mountflags/mflags/) Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-22libmount: rename mount.h to libmount.hKarel Zak2-2/+2
The mount.h file name is too generic. Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-21mount: update ext{3,4} options in mount.8Karel Zak1-2/+56
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-17umount: call is_loop_autoclear() for all loopdevsKarel Zak2-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-11mount: fix reference to cifs-utils in mount.8Karel Zak1-1/+1
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=651035 Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-10mount: fix gcc warningKarel Zak1-4/+4
2011-01-10mount: canonicalize paths in HAVE_LIBMOUNT_MOUNT codeKarel Zak1-15/+23
Reported-by: silvan minghetti <bu1137@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-04remove duplicate includesKarel Zak1-2/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-04docs: fix typos in man pagesKarel Zak1-5/+5
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664458 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664294 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664182 Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: use verbose info for HAVE_LIBMOUNT_MOUNT onlyKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: improve verbose infoKarel Zak1-25/+29
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03umount: add HAVE_LIBMOUNT_MOUNT codeKarel Zak1-0/+12
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: rewrite HAVE_LIBMOUNT_MOUNT codeKarel Zak1-26/+70
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: add mnt_init_debug()Karel Zak3-1/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03losetup: remove unnecessary fstab.h includeKarel Zak1-1/+0
The file is necessary for mount(8) only and should not be used in the generic sundries.c. utils. Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: use libmount for mtab/utab updatesKarel Zak3-3/+82
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03mount: read mtab by libmountKarel Zak1-1/+47
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03build-sys: add --enable-libmount-mountKarel Zak1-0/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03libmount: cleanup mangle() usageKarel Zak1-7/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03libmount: use better format for utab, improve bind mountsKarel Zak2-10/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-29Merge remote branch 'origin/master'LaMont Jones13-67/+304
Conflicts: login-utils/Makefile.am mount/lomount.c text-utils/od.1
2010-12-17swpaon: use canonicalized devnames on -s outputKarel Zak1-10/+28
Old version Filename Type Size Used Priority /dev/sda3 partition 2353516 76 -1 /dev/dm-1 partition 409596 0 -2 New version: Filename Type Size Used Priority /dev/sda3 partition 2353516 76 -1 /dev/mapper/VUL-lvol0 partition 409596 0 -2 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-17swapon: Canonicalize swap deviceAlexey Gladkov1-1/+7
Swapon checks whether a swap device is active by searching for the device name in /proc/swaps. /proc/swaps always specifies the path to real device file, even if the path to real device file, even if symlink was passed to the swapon() system call. This differs from /proc/mounts semantics where each string contains exactly the same device name as it was passed to the mount*() system call. If a swap partition resides on lvm, libblkid returns a name in form /dev/mapper/*, but now there are symlinks pointing to device files /dev/dm-*, resulting to /proc/swaps containing /dev/dm-*, but swapon still looks for /dev/mapper/* and tries to activate the swap partition again. [kzak@redhat.com: - remove unnecessary changes from is_in_proc_swaps()] Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com> Tested-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10fix __noreturn__ usageKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-06mount: be more explicit about --move in mount.8Karel Zak1-3/+18
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01mount: read /sys for loopdev backing fileKarel Zak3-3/+61
On systems without /etc/mtab (or everywhere if kernel >= 2.6.37) we use loop autoclear flag and then the backing file name is not stored in /etc/mtab. mount(8) uses sysfs to get the filename (or LOOP_GET_STATU* ioctls on old kernels). Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01losetup: use /sys/dev/block/.../loop/backing_fileKarel Zak1-1/+43
The basic loopdev attributes are available in sysfs since kernel 2.6.37. This patch uses the backing_file attribute from sysfs for very long filenames (the LOOP_GET_STATUS ioctl uses only 64 bytes for the filename). old version: # losetup -a /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_*) new version: # losetup -a /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_name/ext2.img) Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30rename util-linux-ng back to util-linuxKarel Zak6-11/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30libblkid: add LINHIB0001 signature to swap proberKarel Zak1-1/+2
The new swsuspend signature has been added by commit 3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1. Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org> Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-23lib: [strutils] general purpose string handling functionsDavidlohr Bueso4-7/+7
This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-23mount: mark die() as nonreturnKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-19mount: ignore *context= options on remountKarel Zak1-3/+59
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=563267 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-16mount: update relatime description in mount.8Karel Zak1-0/+9
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=653705 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-10swapon: better text for "discard", note about swapon in fstab.5Karel Zak2-4/+7
Suggested by Hugh Dickins. Thanks. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-01swapon: add "discard" supportHugh Dickins2-12/+39
In kernel 2.6.36 (and in stable kernel 2.6.35.5) I made a tiny change to the swapon(const char *path, int swapflags) system call interface: kernel commit 3399446632739fcd05fd8b272b476a69c6e6d14a swap: discard while swapping only if SWAP_FLAG_DISCARD As things stand at present, we could just remove the swap discard support; but since several filesystems (including ext4 and btrfs and fat) are offering a "discard" mount option, I thought swap should take the same course, and offer a "--discard" or "-d" option to swapon(8). [kzak@redhat.com: - update swapon.8 man page - use for -d the same logic as for -p] Signed-off-by: Hugh Dickins <hughd@google.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-29mount: use utimensat(AT_FDCWD) rather than open()+futimens()Karel Zak1-10/+3
Thanks to Kay Sievers. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-25Merge remote branch 'origin/master'LaMont Jones2-10/+10
2010-10-25swapon: add support for "nofail" fstab mount optionKarel Zak2-3/+11
This option is already supported by mount(8) and fsck(8), there is no reason to have any exception for swap devices. Note that the --ifexists command line option applies to all swap devices, the "nofail" setting is per device. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-25umount: umount -r segfaultKarel Zak1-5/+10
umount(8) segfaults when update incomplete mtab file after remount to read-only (-r). For example autofs does not store info about mountpoint to /etc/mtab file. # mount /dev/sda1 /mnt/test # sed -i -e 's:/dev/sda1 .*::g' /etc/mtab # cd /mnt/test # umount -r /mnt/test umount: /mnt/test busy - remounted read-only Segmentation fault The command "umount -r" should not care about /etc/mtab if the related mtab entry does not exist. Reported-by: Paul Crawford <psc@sat.dundee.ac.uk> Addresses: https://bugs.launchpad.net/bugs/579858 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-21mount: remove warning about FS detection from mount.1Karel Zak1-5/+0
The warning is from util-linux 2.7.1 (year 1996)... the filesystems detection is pretty generic now. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-18Merge remote branch 'origin/master'LaMont Jones7-31/+66
2010-10-07mount: don't canonicalize "spec" with --no-canonicalize optionMiklos Szeredi1-1/+1
"Spec" was still canonicalized despite --no-canonicalize. This resulted in a hang during login with pam_encfs (Debian Bug#593336). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
2010-10-07swapon: warn if file owner is not rootKarel Zak1-0/+4
Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-07umount: use strtosize() for offset=Karel Zak2-4/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-09-30mount: Don't call canonicalize_*(SPEC) for 9pSven Eckelmann1-1/+2
When calling "mount -t 9p -o trans=virtio foobar /mnt/bar" and foobar exists in the current path, the 9p virtio transport driver will be called with $CWD/foobar and fail with "9p: no channels available". Similar problems exist with remote file servers "mount -t 9p 23.42.08.15 /mnt/bar" and Plan 9 From User Space applications "mount -t 9p -o trans=unix,uname=$USER `namespace`/acme /mnt/bar" A similar exception like for nfs, cifs and smbfs must be added for 9p. Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
2010-09-30mount: avoid starting a man page line with a single quoteChris Frost1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>