summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* swapon: remove unnecessary myrealpath() callKarel Zak2008-03-201-9/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: Reinitialize software suspend areas to avoid future corruption.Kees Cook2008-03-201-0/+75
| | | | | | | | | | This is based on the earlier swsuspend re-init patch carried by RedHat, SuSE, and Ubuntu. It has been updated to include passing the known UUID to mkswap, and fixing the fstype name. Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove useless if-before-my_free, define my_free as a macroKarel Zak2008-03-123-19/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* remove useless if-before-free tests.Jim Meyering2008-03-122-8/+4Star
| | | | | | | | | | | | | | | | E.g., in this example, the "if (p)" test is useless. if (p) free (p); I've been removing such tests systematically. Here's where I proposed it to the git folks, along with justification for why it's ok to perform this transformation, these days (no one uses SunOS4 anymore): http://thread.gmane.org/gmane.comp.version-control.git/74187 Signed-off-by: Jim Meyering <meyering@redhat.com>
* mount: don't canonicalize LABEL= or UUID= specKarel Zak2008-03-061-1/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: allow auto-destruction of loop devicesBernardo Innocenti2008-02-194-10/+50
| | | | | | | | | | This allows a flag to be set on loop devices so that when they are closed for the last time, they'll self-destruct. The kernel part has been submitted to lkml by David Woodhouse. Signed-off-by: Bernardo Innocenti <bernie@codewiz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --enable-static-programsStepan Kasal2008-02-181-3/+28
| | | | | | | | Add support for static versions of mount, umount, losetup, fdisk, and sfdisk. Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Stepan Kasal <skasal@redhat.com>
* mount: use canonicalize in getfs_by_devnameKarel Zak2008-02-181-0/+13
| | | | | | | | Fixes a problem when you define a device via a persistent udev device name in /etc/fstab but use the real block device name on mount invocation. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: "can't create lock file" message sometimes means failure, sometimes notMark McLoughlin2008-02-143-7/+15
| | | | | | | | | | | | | | | | | | | | What the patch does is goes from the situation where: 1) If /etc/mtab doesn't exist and /etc is read-only, you get the "can't create lock file" message and the mount fails 2) If /etc/mtab does exist and /etc is read-only,you get the same message but the mount succeeds Clearly, the failure to update /etc/mtab should either cause the mount to fail or not ... sometimes causing it to fail, and sometimes not (each with the same message) is not useful. This patch sets the same behaviour for create and update mtab. In both cases it prints error message and the mount succeeds. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>