summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* mount: inform about UID and eUID when verbose > 2Karel Zak2009-02-181-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use pkg-config for blkid and volume_idKarel Zak2009-02-171-3/+3
| | | | | | | | | | | | It seems that blkid.pc from e2fsprogs has been fixed: $ pkg-config --libs blkid -lblkid and the pkg-config does not return any other extra libraries (such -luuid or -ldevmapper). Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: generic blkid/volume_id wrapper, use blkid_evaluate_*Karel Zak2009-02-1712-562/+206Star
| | | | | | | | | | | | | | | | | | * moves the generic libblkid/libvolume_id wrapper (fsprobe.c) from mount/ to lib/. We'll use the wrapper in cfdisk and fsck. The wrapper supports: - obsolete volume_id (udev) - obsolete libblkid (e2fsprogs) - libblkid (util-linux-ng) * mount, umount and swapon when linked against the new libblkid use - low-level probing code to read LABEL, UUID or FSTYPE from a device - high-level blkid_evaluate_spec() to convert LABEL/UUID to devname Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: libtoolize mount/Makefile.amKarel Zak2009-02-131-36/+52
| | | | | | | | * cleanup mount/Makefile.am * add {VOLUMEID,BLKID}_CFLAGS -- necessary for pkg-config * add support for linking with in-tree libblkid Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: move realpath.c code to lib/Karel Zak2009-02-1112-212/+64Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: non-setuid (POSIX file capabilities) supportKarel Zak2009-02-042-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | The mount command does not work properly if you replace suid with POSIX file capabilities. We still need to check for non-root mounts and the command has to work in very restricted mode for non-root users. This patch allows you to remove suid bit from mount and umount. Note that you need a system with filesystem capability support, e.g. Fedora 10). # ls -l /bin/mount -rwxr-xr-x 1 root root 65192 2008-11-09 22:59 /bin/mount # getcap /bin/mount /bin/mount = cap_dac_override,cap_sys_admin+ep [kzak@redhat.com: all the above comments] Don't bypass security checks when [u]mount uses POSIX file capabilities rather than setuid root to permit non-root mounts. Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com>
* mount: fix typo in volume_id codeKarel Zak2009-01-311-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: document newinstance and ptmxmode options to devptsSukadev Bhattiprolu2009-01-211-0/+55
| | | | | | | | | | | Support for multiple instances of devpts were included in 2.6.29-rc1. Update man pages to document the new options. Additional details about the new options are described in 'Documentation/filesystems/devpts.txt' of kernel source tree. Reviewed-by: WANG Cong <wangcong@zeuux.org> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: cleans up mount(8) troff markupSam Varshavchik2009-01-161-25/+23Star
| | | | | | My patches correct troff markup only. No content changes. Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: cleanup gefs_by_specdir()Karel Zak2009-01-073-29/+22Star
| | | | | | | | | | fix: - don't call canonicalize_spec() for LABELs/UUIDs - simplify the code - rename to getfs_by_devdir(), because we use it only for device names and not for SPECes (see umount.c). Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: finalize support of quoted LABELs/UUIDsKarel Zak2009-01-071-4/+14
| | | | | | | | The [u]mount does not properly support LABEL="foo" or UUID="foo" in /etc/fstab. This patch fix last places where we assume unquoted LABELs/UUIDs only. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: suggest to use blockdev --setro rather than losetupKarel Zak2009-01-061-2/+2
| | | | | | Thanks to Christoph Hellwig. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about semantics of read-only mount to mount.8Karel Zak2009-01-061-0/+6
| | | | | Reported-by: Joachim Wagner <jwagner@computing.dcu.ie> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add rootcontext= SELinux mount optionKarel Zak2008-12-222-1/+11
| | | | | | | | Note, the description in the mount.8 man page is copy & paste from rootcontext= kernel patch (by James Morris). I didn't found anything more useful... (patches welcomed:-) Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: clean up SPEC canonicalizationKarel Zak2008-12-195-19/+42
| | | | | | | | | | | | | | | | | | | | The SPEC (fsname) field in fstab/mtab could be: - devname - NAME=value (e.g LABEL, UUID) - directory (MS_MOVE, MS_BIND, ..) - pseudo-fs keyword (tmpfs, proc, sysfs, ...) the pseudo-fs keywords shouldn't be canonicalized to absolute path. It means we have to differ between SPEC and mountpoint (fs_dir). Unfortunately, the keywords was checked on wrong place. This patch move this check to the new function canonicalize_spec(). The fsname in mtab entry is canonicalized when the FS type is not pseudo filesystem. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix mount_static_LDADDKarel Zak2008-12-121-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: add swap format detection and pagesize checkMatthias Koenig2008-12-052-2/+130
| | | | | | | | | | | | | | | | As swap format depends on the pagesize being used, it may happen that the pagesize of the swap space and the current pagesize differ, resulting in swapon to fail when trying to enable such a swap space. In such a case swapon should rather reinitialize the swap space. [kzak@redhat.com: - add blkdev.c to the global swapon_SOURCES - don't try to detect for huge pages on small swap areas (or when read() returns less than MAX_PAGESIZE) - fix fprintf() format string] Co-Author: Olaf Hering <olh@suse.de> Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove spurious newline from mount.8Mike Frysinger2008-12-051-2/+1Star
| | | | | | | The man page display shows quote marks instead of being interpreted by the .B statement and hidden away due to a spurious newline. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* mount: use subsections in mount.8 DESCRIPTIONKarel Zak2008-11-271-56/+81
| | | | | | | The DESCRIPTION section is huge non-structuralized mess. This patch is attempt to make this part of the man page more readable. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: create separate section for fs-independent options in mount.8Karel Zak2008-11-271-19/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: reorder list of options in mount.8Karel Zak2008-11-271-83/+89
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add i_version supportKarel Zak2008-11-273-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: move pivot_root(8) to sys-utilsKarel Zak2008-11-194-106/+0Star
| | | | | | | | This patch moves pivot_root.{8,c) from mount/ to sys-utils/ directory. There is not ant relation between pivot_root source code and the rest of code in the mount. Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: add warning about read-only modeKarel Zak2008-11-181-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: try to set up loop readonly if EACCESMatthias Koenig2008-11-181-1/+2
| | | | | | | | | | | | | Currently mounting/losetup an image fails if it is accessable readonly. There are no problems if it is a file on a local filesystem. It seems only to happen if it is a NFS mounted image, which is read-write in permission but with root_squash option. set_loop checks only for EROFS to retry open with readonly mode, but in this case we get EACCES. Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* mount: sync tmpfs info in mount.8 with Documentation/filesystems/tmpfs.txtKarel Zak2008-10-061-9/+62
| | | | | Addresses-Red-Hat-Bugzilla: #465761 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: sync FAT info in mount.8 with Documentation/filesystems/vfat.txtKarel Zak2008-10-061-6/+48
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove link to namesys.comKarel Zak2008-10-031-2/+0Star
| | | | | | | | | | Ricardo Catalinas Jiménez wrote: In the man page mount(8) there is the url "http://www.namesys.com/mount-options.html". The web site has been down for a long time and the Namesys company is trying to be sold. Reported-By: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: several strings without gettext stringsPedro Ribeiro2008-10-031-4/+4
| | | | | Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: mtab created multiple times with -a optionKarel Zak2008-10-011-2/+5
| | | | | | | | | | | | | | When /etc/mtab does not exist and mount is called with -a, for every mount point that is mounted a root-fs record is added to mtab. This is because get_mtab_info() sets the flag mtab_does_not_exist to 1 when it doesn't find /etc/mtab. However, if it actually finds /etc/mtab, the variable is not reset to 0. So on every subsequent call to get_mtab_info() (as it is the case when mounting several mount points with the -a option), mount will think that /etc/mtab does not exist, even if it was created in the meantime by mount itself. Reported-By: Jonas Kramer <jkramer@nex.scrapping.cc> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: missing EBUSY error hint messageKarel Zak2008-09-301-5/+16
| | | | | | | | | | | | | | | old version: # losetup /dev/loop0 /foo.img # losetup /dev/loop0 /bar.img; echo $? 2 new version: # losetup /dev/loop0 /foo.img # losetup /dev/loop0 /bar.img; echo $? losetup: /dev/loop0: device is busy 2 Signed-off-by: Karel Zak <kzak@redhat.com>