LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   de mogelijkheden van het mount --bind commando (https://www.linuxquestions.org/questions/linux-general-1/de-mogelijkheden-van-het-mount-bind-commando-160938/)

paulvl 03-22-2004 09:46 AM

de mogelijkheden van het mount --bind commando
 
Ik heb nog een heleboel onduidelijkheden met betrekking tot het mount commando. Ik hoop dat iemand me op de volgende 5 punten wat meer duidelijkheid zou kunnen verschaffen.

1. Kan mount 2 directory's samengevoegd mounten (--bind) in 1 directory? Bijvoorbeeld:
Code:

$ ls audio/lyrics
art1-tit1.lyric
art2-tit2.lyric
$ ls audio/music
art1-tit1.mp3
art2-tit2.mp3
$ ls audio/allfiles
art1-tit1.lyric
art1-tit1.mp3
art2-tit2.lyric
art2-tit2.mp3

2. Is het mogelijk om te mounten (--bind) m.b.v. een filter? Bijvoorbeeld:
Code:

$ ls audio/allfiles
file1.mp3
file2.mp3
file3.ogg
file4.ogg
$ ls audio/mp3s
file1.mp3
file2.mp3
$ ls audio/oggs
file3.ogg
file4.ogg

3. Ik doe mount --bind olddir newdir. Als ik een bestand aanmaak in de olddir is deze netjes beschikbaar in de newdir. Als ik een bestand aanmaak in de newdir, dan is deze niet beschikbaar in de olddir. Dit kan handig zijn, maar is er ook zoiets als een 'totale bind' die de directory identiek maakt (en houdt)?

4. Ik doe mount --bind dirX dirA en mount --bind dirX dirB. Is het mogelijk om de rechten voor de bestanden in dirA read-only te laten zijn terwijl dirB writable is?

5. In de manual pages van mount word gesproken over een --rbind. Het is me echter niet duidelijk wat de eigenschappen hiervan zijn (en waarin deze verschilt van de --bind)

Een hele hoop vragen. Ik hoop dat iemand ze zou willen beantwoorden.

In iedergeval alvast bedankt.

MvG,
Paul van Leeuwen

lone_nut 03-22-2004 10:02 AM

you will get some answers if you write in english.

paulvl 03-22-2004 10:21 AM

Sorry, I posted it before on a dutch forum, but didn't got response. I just copy pasted it without thinking :D

Anyway, here in english:

Right now, the ln command looks like what I need, but there are still some question I can't find the answers to...

1. Is it possible to have 1 directory linking to 2 other directory's? For example:
Code:

$ ls audio/lyrics        (original)
art1-tit1.lyric
art2-tit2.lyric

$ ls audio/music        (original)
art1-tit1.mp3
art2-tit2.mp3

$ ls audio/allfiles
art1-tit1.lyric
art1-tit1.mp3
art2-tit2.lyric
art2-tit2.mp3

2. Is it possible to link using some sort of filter? Like:
Code:

$ ls audio/allfiles      (original)
file1.mp3
file2.mp3
file3.ogg
file4.ogg
file5.something

$ ls audio/mp3s          (all mp3's found in the allfiles directory)
file1.mp3
file2.mp3

$ ls audio/oggs          (all ogg's found in the allfiles directory)
file3.ogg
file4.ogg

4. Is there some contruction to apply multiple rights to a file? For example:
Code:

$ ln -s /somewhere/only/accesible/by/root /home/phil    (read-only)
$ ln -s /somewhere/only/accesible/by/root /home/rob    (writable)

5. What is the difference between hard-links and soft-links? The only thing they where able to explain me was that hard-links don't work on directory's.

6. Last but not least: is it possible to let a script run on specific events? (like someone changing something in the directory content?

A lot a questions, I know. I hope they're not all dump questions:D

Anyway, thanks a lot for reading, even more when answering,

Ciao,
Paul van Leeuwen

lone_nut 03-22-2004 11:41 AM

Okay i prommised you some answers:
1:you can make a link from a file to a file, or many files. But if you make a new file, you will have to make a new link
5: i you make a hard link to a file and delete the original, the copy still is present, and still works. Basicly the reference to the file is deleted, but the content is not. If all references to a file is removed the contens will be erased, leving the space free. (note if you override the content, instead of deleting the file it is lost)
A soft link is basicly a request to the OS to open some other file.
To be able to create a hard link, both the "files" must be on the same partion/disk. Otherwise only a soft link would work.

6:
Crontab is usefull for this purpose. For more info type:
man crontab

paulvl 03-26-2004 11:31 AM

Many thanks
 
Thanks for your help. I'm doing quite funny things with linking; quite usefull too.
The crond is still not doing what it is supposed to, but that is a settings problem I can fix on my own.

So, thanks a lot

PvL


All times are GMT -5. The time now is 07:15 AM.