Saturday, March 06, 2004

Re: mount

And a request for more "beginners" linux related info.

mohn, i really suggest you read the pike book hrishi got. i had posted a blog on some fundamentals but i realised it was too long, and i was merely copying stuff. most of the fundamentals are really well explained.


So the next guy who logged in couldn't access the drive. What's the solution in that situation?

there is no solution. remember to umount. in linux, a device == file. and just as you have permissions for files, there are permissions for devices. once a user mounts a floppy, he owns it. so no one is allowed access. other than the superuser, root. also, if you do not unmount the cd, the cd will not eject from the drive even if you try ejecting. and removing a mounted floppy by force causes the system to become slightly unstable.


Can you elaborate a bit on the directory hierarchy.

/ pronounced as root is the highest level of the heirarchy. /bin contains most important system binaries like bash, kill mount etc... /boot contains the boot loader which is generally grub or lilo. /dev contains device files. /etc contains configuration files. /usr contains folders like bin, local, sbin which contain not so important binaries and other files. /var contains logs and stuff. the list i have provided is not exhaustive.


Do all linux distro's contain this exact same hierarchy? If not, how do they differ? Also what if they want to add some custom "user friendly" feature like "My Documents" or something... where would that folder be located?

actually there were many different *nix based os'es. then they decided to standardize under a definite set of rules. not getting the name right now. something like IPC V or so. please correct. so more or less the directory structure, along with some standard commands were fixed.

one major difference between *nix and windows is this. in linux when you install a program, it gets stored all over the file system. config files go in etc, some parts go in /lib, and the exe will go in some bin folder. and like you mentioned My Documents. this is the folder within /home. like say /home/rahul. all applications have different settings for different users. these are stored in the users home folder. this is yur place, yur home. try
$ cd ~
$ pwd


Also what exactly are executables in Linux called? What extensions do they have?

executables in *nix are ELF files. (Executable and Linkable Format). in linux extensions have no meaning (i would appreciate if hrishi could clarify). when you try to run a file linux reads the file and checks headers to determine file type. then takes necessary action. also you can have any length extensions. also something like file.tar.bz2 is valid.


Every new device you mount will be added under /dev? So if I mount a zip drive or whatever, it should appear there.

all devices possible on your system are already present in the /dev directory. when you mount it gets added to the filesystem. in /dev directory you cannot directly write into devices. so you mount along with filesystem type. like cd's are iso9660 or something.


What counts as secondary devices?

primary secondary depends on what bus the device is internally connected to the motherboard. there are two buses in standard x86.

master slave depends on the jumper settings you chose for the device.


This is quite cool. So I can access my music stuff on Windows which is in the main hd (hda). Does mount work "by value" or "by reference". As in, does it make a copy of the files in hda6?

cool i feel is an understaement. there i so many things in linux which are made for interoperability between systems. some stuff is really amazing. and lots lots more to discover.

refernce.. all changes will be reflected and permanent.


So, sorry for the whole bunch of stupid questions. My aim is to advance to intelligent ones after reading your posts on Linux.

hey mohn, don't embarass me. all of us are just trying to learn. we have lots to share. i needed some info how generics work in C++. probably mohn or dinesh could post some stuff.

No comments: