summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* umount: no checking mount point removalSigned-off-by: Guan Xin2008-09-291-25/+4Star
| | | | | | | | | | | No longer checks if mount point has been renamed or removed. Linux reports EBUSY for these actions, so this check is redundant. [kzak@redhat.com: - remove the check rather than "#if 0" - remove unnecessary mnt_err2 stuff] Signed-off-by: Guan Xin <guanx.bac@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix typoGuan Xin2008-09-291-1/+1
| | | | Signed-off-by: Guan Xin <guanx.bac@gmail.com>
* umount: check for overlaid mountsGuan Xin2008-09-291-1/+20
| | | | | | | | | | Linux cannot umount a device whose mount point is hidden by subsequent mount(s). i.e. We must umount the devices associated to a mount point in the reverse order of when they were mounted. If umount was called violating this rule, report error and exit. Signed-off-by: Guan Xin <guanx.bac@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about /proc/mounts to mount.1Karel Zak2008-09-291-1/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix typoKarel Zak2008-09-251-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: remove dependence on minor numbersKarel Zak2008-08-211-0/+4
| | | | | | | | | | | The latest kernel supports partitioned loop devices (kernel commit 476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change makes minor numbers useless, because mirror number does not match with loop device name (loop<N>). We have to follow loop device names only. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: -a has to complain, fix leaksKarel Zak2008-08-191-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The "swapon -a" command (without "-e" option) has to complain always when LABEL or UUID does not exist. Test: # grep foo /etc/fstab LABEL=foo swap swap defaults 0 0 Old version: # swapon -a; echo $? 0 Fixed version: # swapon -a; echo $? swapon: cannot find the device for LABEL=foo 255 # swapon -a -e; echo $? 0 This version also fix two memory leaks. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add docs about utf8=0 for vfatKarel Zak2008-08-121-3/+4
| | | | | Addresses-Red-Hat-Bugzilla: #454354 Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: looplist_* refactoring, remove scandir()Karel Zak2008-08-041-149/+153
| | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces scandir-based implementation with readdir(). The readdir(3) is less expensive and more portable (to non-glibc environment). The patch also replaces sysfs-based solution with simpler /proc/partitions parsing. The /proc/partitions includes all used loop devices on all systems (include 2.4). This solution seems faster than scandir(/sys/block/) too. Summary, the losetup (with this patch) uses three methods to found a loop device: a) parse /proc/partitions to found already used loop devices (for loserup -a) b) stat(2) for all loop[0-7] devices (default number of loop devices). This is classic method from util-linux <= 2.13. This method is good enough for standard Linux machines with default number of loop devices. c) scan all /dev or /dev/loop/ for loop devices. This is useful for crazy people who need more than 8 loop devices. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: retry on ENOMEDIUMMatthias Koenig2008-07-302-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a change in kernel behaviour when opening CDROM devices, we need to retry the open/mount call when ENOMEDIUM is returned. Explanation from Tejun Heo: Okay, the difference is from the addition of cdrom_get_media_event() call to both sr_drive_status() and ide_cdrom_drive_status(). Previously, the cdrom driver can't differentiate between tray closed w/ no media and tray open and always returned tray open, which triggers close and retry in the open logic which probably have delayed things enough to get the media recognized. Now the cdrom driver can discern between tray closed w/o media and device not ready for other reasons and returns -ENOMEDIUM on the former. This is all good and dandy but the problem seems that some drives report no media right after the tray is closed but it hasn't properly detected the media yet. It seems the only way to work around the problem is via sensible retries (e.g. try three times 5 secs apart) and I don't think we can add that type of retry logic into cdrom open path. Please note that the previous logic wasn't water proof. Some drives can take longer to recognize the media is there and could have failed the in-kernel retry too. Also, reading the media can take quite some time and during that period the drive reports media present but device not ready. The driver will retry the command (e.g. READ TOC for open) five times but all of them can fail w/ EMEDIUMTYPE. [kzak@redhat.com: - add CRDOM_NOMEDIUM_RETRIES to blkdev.h - add verbose message to mount.c] Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add shortoptions for bind, move and rbindmaximilian attems2008-07-292-15/+34
| | | | | | | | | | | | | | | | | | | Reserving uppercase letters for mount operations: --move | -M --bind | -B --rbind | -R Add lowercase for the most needed mount operation that happen in initramfs: mount -M /sys /root/sys Note, we still have shared-subtree operations (--make-{slave,private,...}) without short options. [kzak@redhat.com: minor change in mount.8] Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about tz=UTC option for FAT to mount.8Karel Zak2008-07-281-0/+8
| | | | | CC: Joe Peterson <joe@skyrush.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* remove CVS keywordsmaximilian attems2008-07-282-3/+1Star
| | | | | | | | this patch removes old CVS keywords from comments. mount(8) works for newer Linux then 0.99 ;) Signed-off-by: maximilian attems <max@stro.at>
* mount: make file_t SELinux warning optional and shorterKarel Zak2008-07-241-5/+3Star
| | | | | | | | | | | | | The patch: Commit: 4edebc1486133231e38b3881325c374eda567f74 Date: Mon Jun 23 13:00:00 2008 +0200 Subject: mount: warn on "file_t" selinux context introduces a new warning. This warning should be shorter and optional -- it means visible in verbose mode only. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: s/MOUNTED/_PATH_MOUNTED/maximilian attems2008-07-241-1/+1
| | | | | | | | no longer use deprecated alias. clears a useless compile error when compiling against klibc: mount.c:995: error: `MOUNTED' undeclared (first use in this function) Signed-off-by: maximilian attems <max@stro.at>
* mount: sundries.h add klibc supportmaximilian attems2008-07-241-3/+0Star
| | | | | | | | | | | | In file included from mount.c:34: sundries.h:16:23: error: rpc/types.h: No such file or directory nuke rpc/types.h to fix aboves. The file is archaism from old integrated NFS code. Cc: Christoph Hellwig <hch@infradead.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: maximilian attems <max@stro.at>
* losetup: clean up code around LO_FLAGS_AUTOCLEARKarel Zak2008-07-021-21/+20Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: improve "-d" option for autoclear loopsKarel Zak2008-07-023-2/+34
| | | | | | | | | | | The new loop auto-destruct feature detaches automatically loop devices when no longer used. This means they are detached with the umount() call. But when we call umount with -d, del_loop() is called and fails because the ioctl() returns ENXIO. We have to check for autoclear loop devices rather than blindly call del_loop(). Reported-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: warn on "file_t" selinux contextKarel Zak2008-07-011-3/+26
| | | | | | | | | | Currently if I mount a file system without labels, it works fine, but later or SELinux will start printing denials and stopping certain applications from working. It would be nice if the mount command checked it in selinux mode. Addresses-Red-Hat-Bugzilla: #390691 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add norealtime to mount.8Karel Zak2008-06-161-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix a small typo in mount.8Christophe Blaess2008-06-091-1/+1
| | | | | | | | | | | While working on french translation of the Linux Man Pages, I've found a small typo in mount.8. Only one wrong letter : the option "osyncis_o_sync" for XFS filesystem is erroneously replaced by "osyncis_d_sync" (the previous option). Signed-off-by: Christophe Blaess <Christophe@Blaess.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remount doesn't care about loop=Karel Zak2008-05-192-1/+106
| | | | | | | | | | | | | | | | | | | | | The command # mount -oremount <spec> <dir> doesn't read fstab or mtab. This is expected behaviour. Unfortunately, we have to care about the internal loop= option which is generated and maintained by mount(8)/umount(8). The loop= option has to be persistent. How to reproduce this bug: # mount -o loop /home/images/vfat.img /mnt/img; grep vfat /etc/mtab; \ mount -o remount,ro /home/images/vfat.img /mnt/img; grep vfat /etc/mtab; /home/images/vfat.img /mnt/img vfat rw,loop=/dev/loop0 0 0 /home/images/vfat.img /mnt/img vfat ro 0 0 Reported-By: David Chinner <dgc@sgi.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: fix typo in losetup.8Karel Zak2008-04-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: split help message into two smaller partsBenno Schulenberg2008-04-161-4/+5
| | | | | | | | As it has already changed since the previous release, take the opportunity to cut it into two more manageable chunks for translators. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix swsuspend detectionKarel Zak2008-04-151-1/+10
| | | | | | | | | | | | Welcome to hell where S1SUSPEND/S2SUSPEND is "swsuspend" in libblkid and "suspend" in libvolume_id Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix typo in mount.8Karel Zak2008-04-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: mark the option -s as deprecatedKarel Zak2008-04-152-4/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add support for sizelimit= mount option (for loop mounts)Shachar Shemesh2008-04-152-6/+8
| | | | | | [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Shachar Shemesh <shachar@lingnu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: add --sizelimit optionShachar Shemesh2008-04-154-12/+29
| | | | | | [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Shachar Shemesh <shachar@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: ignore a bunch of generated files, mostly binariesJames Youngman2008-04-141-0/+6
| | | | | Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove set_proc_name()Karel Zak2008-04-091-13/+0Star
| | | | | | This function has been used in background mount code. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove built-in support for background mountsKarel Zak2008-04-022-37/+5Star
| | | | | | | | | EX_BG is archaism from old integrated NFS code. The built-in NFS code has been removed in the previous version and all "bg" stuff is handled by /sbin/mount.nfs. It seems we can remove all "bg" stuff from mount(8). Signed-off-by: Karel Zak <kzak@redhat.com>