LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the difference between /etc/fstab and /etc/mtab? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-difference-between-etc-fstab-and-etc-mtab-4175429451/)

chinabenjamin66 09-28-2012 10:13 AM

What is the difference between /etc/fstab and /etc/mtab?
 
Hi guys(girls),

I run across a problem when mounting a block device to a mount point.
I found that there is no relative item about this block device in /etc/fstab, and umounted this block device in case it was really mounted before.
but no matter how many time I have tried to mount this block device to a point, it always prompts it is mounted or the point is busy.
any help and explanation will be appreicated.

pampers 09-28-2012 10:38 AM

/etc/mtab represent currently mounted filesystems

/etc/fstab represent those configured to be mounted by the installation or sysadmin.

Now, the block device you're talking about is a fuse filesystem? when the system answer that the device is already mounted is because it is there mounted...now, you cannot umount a partition or device if the following is happening:

* /dev/sdb1 is mounted in /dev/media/me (for example) and you are in a shell inside /dev/media/me and try to umount /dev/media/me or /dev/sdb1 the system will answer you that the device is busy, and wouldn't allow you to umount it. The same thing will happen if you or someone else on your network have some file opened and the file belongs to /dev/sdb1 that is mounted on /dev/media/me, if you or that someone that have the file opened through the network don't close the file, you cannot umount /dev/sdb1

The partition to be able to be umounted need to not be busy, and busy means having some file that belongs to that partition opened, or having your user inside that partition.

chinabenjamin66 09-28-2012 10:44 PM

Quote:

Originally Posted by pampers (Post 4791660)
/etc/mtab represent currently mounted filesystems

/etc/fstab represent those configured to be mounted by the installation or sysadmin.

Now, the block device you're talking about is a fuse filesystem? when the system answer that the device is already mounted is because it is there mounted...now, you cannot umount a partition or device if the following is happening:

* /dev/sdb1 is mounted in /dev/media/me (for example) and you are in a shell inside /dev/media/me and try to umount /dev/media/me or /dev/sdb1 the system will answer you that the device is busy, and wouldn't allow you to umount it. The same thing will happen if you or someone else on your network have some file opened and the file belongs to /dev/sdb1 that is mounted on /dev/media/me, if you or that someone that have the file opened through the network don't close the file, you cannot umount /dev/sdb1

The partition to be able to be umounted need to not be busy, and busy means having some file that belongs to that partition opened, or having your user inside that partition.

At first, your reply is very useful for me.
I hope we can continue with this topic, the Linux I used is a embeded Linux system. How to check whether the block device is a fuse filesystem or not?


All times are GMT -5. The time now is 09:35 AM.