summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* mount: more explicitly explain 'strictatime' in mount.8Karel Zak2009-09-111-5/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* replace usleep() for systems that don't have themDaniel Mierswa2009-08-211-0/+1
| | | | | | | | | This function is marked obsolete in POSIX.1-2001 and removed in POSIX.1-2008. Conditionally replaced with nanosleep(). Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* mount: mention mtab for single mount point mount in mount.8Peter Volkov2009-08-181-1/+3
| | | | | | | | | | | | | | Karel Zak wrote: "This is very old (10+years) feature. The mount(8) is trying to found mountpoint/device in fstab and then in mtab. I guess the original purpose for this feature is user-friendly 'mount /node -o remount'. Unfortunately, the code does not check for MS_REMOUNT flag and consults mtab in all cases. (The code is consulting fstab/mtab before mount options parsing.)" This commit documents this feature. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: clean up mount.8Karel Zak2009-08-181-100/+101
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "mount: clean up mount.8"Karel Zak2009-08-181-101/+100Star
| | | | | | | | | This reverts commit 98c7944b52c54c86fb5b9d73fbead9442bfa0e30. Unfortunately, the patch has been committed by "git commit -a" and includes unwanted changes in configure.ac and sys-utils/Makefile.am... Sorry.
* mount: clean up mount.8Karel Zak2009-08-171-100/+101
| | | | | | | | | * use "filesystem" everywhere (currently, the mount.8 man page is inconsistent and uses "file system" and "filesystem") * fix "The extN" to "The extN filesystem" (reported by Theodore Tso) Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about ext{3,4} barriers to mount.8Karel Zak2009-08-171-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon.8: formattingPeter Breitenlohner2009-08-171-7/+3Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* mount.8: formattingPeter Breitenlohner2009-08-171-77/+111
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* losetup.8: formattingPeter Breitenlohner2009-08-171-8/+6Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* fstab.5: formattingPeter Breitenlohner2009-08-171-3/+3
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* umount.8: command line for umount helpers, formattingPeter Breitenlohner2009-08-171-4/+14
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* replace bcopy,bzero,index and rindexDaniel Mierswa2009-08-173-5/+5
| | | | | | | | | Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in POSIX.1-2008. Replaced with memmove,memset,strchr and strrchr. Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* mount: when a remount to rw fails, quit and return an errorValerie Aurora2009-07-141-0/+4
| | | | | | | | | | | | | | | A nice feature of mount is that when you attempt to mount a file system read-write, and that fails because it can only be mounted read-only, it goes ahead and retries the mount with the "ro" option and returns success if that succeeds. However, this code path is also followed when you are doing a remount for the sole purpose of changing the mount from read-only to read-write - the change fails, but mount returns success. Instead, check if we are attempting to remount and fail out immediately, instead of retrying with the old "ro" option and whee, happily "succeeding." Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: fix _PATH_DEVKarel Zak2009-07-021-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: clean up _PATH_DEV_* macrosKarel Zak2009-06-302-9/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: fix return codes of functions arounf is_associated()Karel Zak2009-06-301-16/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: allow loop suid umountKay Sievers2009-06-301-4/+44
| | | | | | Addresses-Suse-Bug: #461732 Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: a little clean up info about loopdevs in man pageKarel Zak2009-06-261-7/+7
| | | | | Addresses-Debian-Bug: #478600 Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: suggest to use modprobe rather than insmod in losetup.8Karel Zak2009-06-261-3/+3
| | | | | Addresses-Debian-Bug: #334796 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about obsolete vfat options to mount.8Karel Zak2009-06-261-5/+6
| | | | | Addresses-Debian-Bug: #329856 Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: clean up help outputKarel Zak2009-06-261-3/+3
| | | | | Addresses-Debian-Bug: #320500 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: move MS_{PROPAGATION,BIND,MOVE} detectionKarel Zak2009-06-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit does not properly fix the problem with "none" fstype and MS_{PROPAGATION,BIND,MOVE} flags. The real fstype has to be replaced with "none" before we try to use /sbin/mount.<type> helper. Old version: # grep test /proc/self/mountinfo 16 18 0:19 / /mnt/test rw,relatime - tmpfs tmpfs rw # ./mount -v -v -v --make-private /mnt/test mount: fstab path: "/etc/fstab" mount: mtab path: "/etc/mtab" mount: lock path: "/etc/mtab~" mount: temp path: "/etc/mtab.tmp" mount: UID: 0 mount: eUID: 0 mount: spec: "tmpfs" mount: node: "/mnt/test" mount: types: "tmpfs" mount: opts: "rw" mount: external mount: argv[0] = "/sbin/mount.tmpfs" mount: external mount: argv[1] = "tmpfs" mount: external mount: argv[2] = "/mnt/test" mount: external mount: argv[3] = "-v" mount: external mount: argv[4] = "-o" mount: external mount: argv[5] = "rw" tmpfs on /mnt/test type tmpfs (rw) # grep test /proc/self/mountinfo 16 18 0:19 / /mnt/test rw,relatime - tmpfs tmpfs rw 17 16 0:20 / /mnt/test rw,relatime - tmpfs tmpfs rw Fixed version: # grep test /proc/self/mountinfo 16 18 0:19 / /mnt/test rw,relatime - tmpfs tmpfs rw # ./mount -v -v -v --make-private /mnt/test mount: fstab path: "/etc/fstab" mount: mtab path: "/etc/mtab" mount: lock path: "/etc/mtab~" mount: temp path: "/etc/mtab.tmp" mount: UID: 0 mount: eUID: 0 mount: spec: "tmpfs" mount: node: "/mnt/test" mount: types: "tmpfs" mount: opts: "rw" mount: mount(2) syscall: source: "tmpfs", target: "/mnt/test", filesystemtype: "none", mountflags: 262144, data: (null) # grep test /proc/self/mountinfo 16 18 0:19 / /mnt/test rw,relatime - tmpfs tmpfs rw Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use "none" fstype for MS_PROPAGATION mountsKarel Zak2009-06-101-1/+1
| | | | | Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add ext4 to the list of filesystems in mount.8Karel Zak2009-06-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add ext4 to mount.8Karel Zak2009-06-011-5/+105
| | | | | | Based on Documentation/filesystems/ext4.txt Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: cleanup notes about -l option in mount.8Karel Zak2009-06-011-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: add --set-capacityKarel Zak2009-05-293-6/+50
| | | | | | | | | | | | | | | | | | | | | | The LOOP_SET_CAPACITY allows to resize loop device size. Example: # blockdev --getsize64 /dev/loop0 10485760 # dd if=/dev/zero of=/home/images/aaa.img count=10 bs=1M oflag=append conv=notrunc # blockdev --getsize64 /dev/loop0 10485760 # ./losetup --set-capacity /dev/loop0 # blockdev --getsize64 /dev/loop0 20971520 CC: J. R. Okajima <hooanon05@yahoo.co.jp> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use TAG parsing function from libblkidKarel Zak2009-05-291-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (and fsck) remove libvolume_id supportKarel Zak2009-05-221-8/+0Star
| | | | | | | The libvolume_id is deprecated in favor of libblkid. The libblkid from u-l-ng provides the same functionality as libvolume_id. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix undefined reference to `security_get_initial_context'Karel Zak2009-05-211-1/+1
| | | | | | | | | | > Gentoo-hardened stable have: sys-libs/libselinux-1.34.14 > I have: > mount.c:(.text+0x12ce): undefined reference to `security_get_initial_context' Reported-by: Максим Бритов <maxim.britov@gmail.com> Addresses-Gentoo-Bug: #270168 Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: handle symlinks in /dev/loop/Mike Frysinger2009-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The loop_scandir() expects all the files in /dev/loop/ to be actual devices and not symlinks to devices. However, udev by default sets up symlinks in /dev/loop/ thereby breaking the fallback scan logic when looking for devices more than the default number of 8. Simple way to reproduce is: - <detach all devices> - cd /dev/loop - rm -f [2-7] - losetup 0 autogen.sh - mv 1 8 - for n in {1..7} ; do ln -s 0 $n ; done - losetup -f <error but should have found /dev/loop/8> [kay.sievers@vrfy.org: just a note, udev does not do that by default. It is devfs-nonsense, which the "default" never did.] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Mario Bachmann <grafgrimm77@gmx.de>
* losetup: mount endless loop hangKarel Zak2009-04-231-1/+5
| | | | | | | | | | | | Based on fix-hang-on-stale-nfs.diff from SUSE src.rpm package. It seems better to more precisely check for ENXIO rather than assume that all LOOP_GET_STATUS errors mean that the device is not used. Addresses-Novell-Bugzilla: #449646 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: Add strictatime supportMatthew Garrett2009-03-273-0/+14
| | | | | | | | 2.6.30 adds (patch d0adde574b8487ef30f69e2d08bba769e4be513f) support for a strictatime mount parameter, used to request strict atime update semantics. The following patch adds support for it to mount. Signed-off-by: Matthew Garrett <mjg@redhat.com>
* swapon: add error messages for lseek and writeKarel Zak2009-03-051-2/+6
| | | | | | Thanks to Hugh Dickins. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix typo s/warn/warnx/Karel Zak2009-03-051-3/+3
| | | | | | Thanks to Hugh Dickins. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix wording in man pageKarel Zak2009-03-051-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: fix fsprobe wrapper (const char * is nonsense)Karel Zak2009-03-031-2/+2
| | | | | | The fsprobe_ functions return newly allocated strings. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix gcc warning (variable used uninitialized)Karel Zak2009-03-031-1/+1
| | | | | | | | | | fstab.c: In function ‘getfs_by_spec’: fstab.c:400 warning: ‘name’ may be used uninitialized in this function fstab.c:402 warning: ‘value’ may be used uninitialized in this function Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: add -f/--fixpgsz optionKarel Zak2009-03-032-9/+28
| | | | | | | | | | | | | | | | | | The patch: commit 3399a218f4eff4016a22044e7c416521bc37c53c Author: Matthias Koenig <mkoenig@suse.de> Date: Thu Nov 27 12:32:56 2008 +0100 swapon: add swap format detection and pagesize check introduced a new feature. This feature should be optional (disabled by default) to keep happy people who use swap-space bad blocks or nonstandard swap-space size. CC: Hugh Dickins <hugh@veritas.com> CC: Olaf Hering <olh@suse.de> CC: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: cleanup man pageKarel Zak2009-03-032-43/+63
| | | | | | The patch also fix stupid bug in swapoff long options array. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: rewrite SWSUSPEND signature rather than exec mkswapKarel Zak2009-03-031-11/+33
| | | | | | | | | | | > On Thu, Jan 22, 2009 at 04:46:57PM +0000, Hugh Dickins wrote: > Though your swapon may mkswap for suspend reasons: hmm, wouldn't it > do very much better just to rewrite the swap signature, than exec > mkswap - maybe nobody ever uses the badpages list, but it really > should be respected. CC: Hugh Dickins <hugh@veritas.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: do_swapon() refactoring (split into two functions)Karel Zak2009-03-031-42/+47
| | | | | | | | | The patch moves all checks to the separate swapon_checks() function. This is a little more aggressive, but currently the do_swapon() is too long. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: use err.h stuffKarel Zak2009-03-031-77/+43Star
| | | | | | | The code is much more simple with warn()/err() that with fprintf() and strerror(), ... Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: simplify spec to devname conversionKarel Zak2009-03-032-18/+22
| | | | | | | | | We needn't to use spec_to_devname() and check for pseudo filesystems. The swap{on,off} is always checking for the 'swap' fstype. This patch also removes the dependence on xmalloc.c. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: add generic swap_get_header()Karel Zak2009-03-021-106/+121
| | | | | | | | | We need to proper swap header detection for swsuspend data and for swap PAGE_SIZE checks. It's better to reuse the code in both cases. The patch removes duplicate stat() call too. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: do_swapon() refactoring (move stat() checks)Karel Zak2009-03-021-24/+25
| | | | | | | It's better to do stat() based checks immediately after the stat() call. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove useless if-before-free testsKarel Zak2009-02-241-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: cleanup man pageKarel Zak2009-02-191-8/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: detach more devices by "-d <loop> [<loop> ..]"Karel Zak2009-02-192-15/+22
| | | | | | | | | | | | | | This patch allows to detach more devices by "losetup -d", for example: # losetup -a /dev/loop0: [0804]:9955739 (/home/images/ary0.img) /dev/loop1: [0804]:9955740 (/home/images/ary1.img) /dev/loop2: [0804]:9955745 (/home/images/ary2.img) # losetup -d /dev/loop0 /dev/loop1 /dev/loop2 Signed-off-by: Karel Zak <kzak@redhat.com>