Table of Contents
If you want to send us your comments, please do so. Thanks
More on comments
Mount
Warnings
When a device is mentioned in fstab do not mount with mount /dev/device /mountpoint. By doing so the options mentioned in fstab will be ignored
Use mount -a
Source: the mount manpage under: “The /etc/fstab, /etc/mtab and /proc/mounts files”
When a terminal, after boot, is in a certain directory and that directory is mounted on an external directory on an other device say on /mnt/mounteddirectory a cd ../mounteddirectory is needed to actually get in the external mounted directory. Otherwise the unmounted local directory is read and used. Check with ls
Mount related programs
Name | Description | Remark |
---|---|---|
findmnt | Show the tree of mounted filesystems | |
fstab | A file with static information about the filesystems | |
losetup | Set up and control loop devices | |
mount | Mount a filesystem | |
mountd | ||
udisks | Disk Manager | |
udisksd | The udisks system daemon | |
udisksctl | The udisks command line tool | |
umount | Unmount file systems | If you get the “target is busy” error message. Check with lsof /pathto/busydirectory. This is mostly in a tremial. Close any program there and leave that directory. Try the -f or -l option in case a network could be the cause |
umount.udisks | Unmount file systems that have been mounted by udisks |
Mount an .iso file
As root
mkdir /mnt/isofile mount -o loop someisofile.iso /mnt/isofile
Look in the isofile
ls /mnt/isofile
Mount an .img file
This can be done with the script form mafintosh of which we made an upgraded version: mount-img.v2.sh.gz. Do
mount-img.v2.sh --help
to show the help text
Mount an USB stick easy as normal user
Add to /etc/fstab
LABEL="TheLabelOfTheUSBstick" /mnt/usbstick ext4 rw,suid,dev,exec,noauto,user,owner,async 0 0
The second 0 needs to be zero, so no check if preformed at boot time.
If it is 2 when booting fsck tries to check it, which fails is there is no USB stick is inserted.
Now the USB stick can be mounted as normal user with
mount -L TheLabelOfTheUSBstick
It becomes even easier with an alias
alias um='mount -L TheLabelOfTheUSBstick'
Now you can mount the USB stick easly with this alias
um
Mount a diskette as normal user
Add to fstab (change to your needs)
/dev/fd0 /mnt/diskette auto rw,user,noauto 0 0
then run as a normal user
mount /dev/sdc
Now the diskette is mounted to /mnt/diskette and a normal user can read and write to it
Unmounting the diskette
Do once
visudo Add: **user ALL=(root:ALL) NOPASSWD:/bin/umount /mnt/diskette** save close visudo
From now on the diskette can be unmounted with umount /mnt/diskette
Mount loop device
A “loop” device in Linux is an abstraction that lets you treat a file like a block device. It can be used to mount a CD image
Mount errors
wrong fs type
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.
Solutions:
- Check if the partition is formatted and if not, format it
- If mounted unmount. Try again
- This may be a partition created in non existent space, partition in non existent space, on the drive in case of a fraud USB drive
can't read superblock
mount: /dev/sdc: can't read superblock
The drive, diskette, is probably defective
Device not visible
Sometimes after insterting an USBstick it is needed to run as root
blkid
in order to make the USBstick visible for the system. Maybe
sudo blkid
will also work. Not tested yet
Large >= 2TB ntfs formatted drives
Mount with
mount -t ntfs-3g /dev/sdx1 /mnt/mountpoint/
When you get an Input/output error do
dmesg | tail -n 20
Check if there is a Very big device. Trying to use READ CAPACITY(16). Do
hdparm /dev/sdx
Do
fdisk -l
and see what partition type is used. MBR or GPT
If possible reformat the drive. See Format an usbdrive with ntfs
sshfs
As normal user:
sshfs 192.168.1.1:/mnt/remotedirectory /mnt/localdirectory/
which is succesfull
As root from here:
cd /mnt/localdirectory
results in
bash: cd: /mnt/localdirectory: Permission denied
ls -l /mnt | grep localdirectory
shows:
ls: cannot access /mnt/localdirectory: Permission denied d????????? ? ? ? ? ? localdirectory
Unit is bound to inactive unit
The partiition will not mount to a mount point
In /var/log/syslog it says
Nov 6 14:16:36 hostname systemd[1]: mnt-directory.mount: Unit is bound to inactive unit dev-disk-by\x2duuid-hash1\x2hash2\x2hash3\x2hash4\x2hash5.device. Stopping, too.
Solution: Run as root systemctl daemon-reload
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.