This is very broad
- local partition are mounted as a whole. You cannont mount it partially.
- you can (and usually do a lot) mount partition over other partition. exisiting data is "hidden" (e.g. file
foo.txtin/mnt/a/b/foo.txtis hidden when you mount "b" on/mnt/a/b) - yes you can, it it advised to mount local over local, distant on distant or local, but you can mount local ext3 over an nfs over an ext3 over ...
- it depends on your need.
- mount point dissapear at boot unless writen in /etc/fstab.
You can create temporary device and mount point using
dd if=/dev/zero count=100 bs=1K of=foo,dd if=/dev/zero count=100 bs=1K of=foo,- then
mkfs -t ext3 foo,then
mkfs -t ext3 foo, - then, as root,
mount foo /mntthen, as root,
mount foo /mntunmount
/mntand deletefoowhen done.
unmount /mnt and delete foo when done.
as per request.
you have /dev/sda1 /dev/sda2
ls /mnt
#empty
mount /dev/sda1 /mnt/a
error mount point doesn't exist (1)
mkdir /mnt/a
mount /dev/sda1 /mnt/a
ls /mnt
a
ls /mnt/a
# empty
mkdir /mnt/a/b
date > /mnt/a/b/foo.txt
mount /dev/sda2 /mnt/a/b
ls /mnt/a/b
# empty
umount /mnt/a
device busy (2)
date > /mnt/a/b/bar.txt
ls /mnt/a/b
bar.txt
umount /mnt/a/b
ls /mnt/a/b
foo.txt
- (1) you must mount on existing dir.
- (2) /mnt/a can't be unmounted, because there is a mount point using it (/mnt/a/b )