Tuesday, September 25, 2007

OPS335 W4L1

OPS335 FREEEEEE^^^^^^^^^^^^^^^^^^^^^


Confusing about the hard drive layout, if he shows us pictures of sector 0 which is the first sector on the drive, sector 0 is going to be the MBR, after that you have the first partition so you have partition number 1 it’s a whole bunch of sectors it be at least one cylinder well the first partition is the 1st sector of the 1st partition, so if he said for example, lets say sda if he says dd if=sda then sda is going to be the mbr if sda1, then you will be getting the 1st sector of the 1st partition, and pretend we have portions number 2 this is the first sector of the second partition, so sda2 then your copying another sector and not the 1, the MBR is bootable that’s when you do the file command it’s a bootable file, the other sda1 and sda2 are not bootable cause they are second in command, but always the mbr is first if you file one of mbr it will just say data. Mymbr 512 bytes

Df look at whats on ram
Fdisk –l look hat the partitions

Ls / is the ram only system

Mount /dev/sda2 /mnt

Find /john –name menu.lst

Updatedb – updates whole database

So we went over how linx boots

POST
BIOS –activates code, program comes with the main board. Grabs MBR
MBR – LILO or GRUB NTLDR any loader you want then executes in memory reads the Kernel and initial ram disk

Initial ram disk file holds drivers that the kernels needs to mount the fs
Kernel – probes all your hardware, on your main board there are hardware ports for many different busses, each port has an address and all the kernel does when its booting up it sends a messages to all the buses then all the ports on the busses, asking is their anything their, 18 PCI if theirs nothing their in micro second the kernel says theirs nothing their, if it sends to you network card it will send a string back, the name of the piece of hardware, network card made by intel…..

Then is mounts the root file system then it mounts it then inside the root file system it finds the init program and init looks inside /etc/inittab, and from here it knows the run level…7 diff run levels after init it calls rc, small name for a important programs now that is knows the run level it will go to directory that is called rc3.d it will go into that directory and all of the scripts that start with a capital s will run them in numerical order, each one represents a sub-system …a start up of a sub-system.

When you see fedora or suse then it says done every of the green lines is one script finished it’s the script that writes that line out that means its done. FAILED, STARTED, u know which is working or not, …


Run level 3, its multi-user with network, run level three ill let everyone log ssh, ftp. In the dir /etc/init.d this is the scripts of all the sub-systems in the computer, if you did not install sh server the script would not be their. The important thing to note the scripts are used for start up and for shutdown, if you want to start up the sshd server you use the same scripts, how does it know what to do by the link name capital S or K, when it calls the script and it begines with a S its starting and with a K shutting down, so where are these scripts > rc3.d their all links some are capital S and some capital K and each are al ink to the other scripts ls –l S09sshd it linked to sshd this is the start up script to start the SSH server,

Run level 5 graphics multi-user network

Ps ax | grep sshd

What ever service ur running u will have the actual program and also a start up and shutdown script,

Carpald – server
Carpal – start and shut down script


telnet 3 drops you to run level three, it will run all the shutdown scripts for 5 and start up for 3, better then doing a reboot,

wall write to call
ln – link
chkconfig

init telinit
ls is a user process
how is a daemon different

No comments: