Grub 2 Recovery:-
Boot from live CD or DVD which support grub2.(BOSS 4 DVD or Ubuntu 9.10 CD
or above. DVD will take more time than CD thats why I suggest to boot from
CD).
Open terminal.Run fdisk -l to check the partition from which you want to
recover grub 2.
Here I assume that you want to recover it form /dev/sda1.
Then run the following commands:-
$sudo mkdir /media/sda1
$sudo mount /dev/sda1 /media/sda1
$sudo mount --bind /dev /media/sda1/dev
$sudo mount --bind /proc /media/sda1/proc
Then chroot into that partition by
$sudo chroot /media/sda1
Then re-install the grub by
#grub-install /dev/sda
The output should be like this:-
Installation finished. No error reported.
If you get error then try
#grub-install --recheck /dev/sda
After successful installation exit from chroot unmount the file systems you
mounted and reboot.
#exit
$sudo umount /media/sda1/proc
$sudo umount /media/sda1/dev
$sudo umount /media/sda1
$sudo reboot
Thursday, June 23, 2011
Friday, June 17, 2011
Using SAMBA Sharing the Directory in a LAN (BOSS 4.0 GNU/Linux )
Global Parameters
[global] Anything in here applies to Samba as a global setting. There is some configuration info here that is important so that Samba and your Windows pc's will function properly. However some global settings can be overridden by share settings (more on this later). I will now go through each line and give a brief description of what role it plays in Samba.
workgroup = home: this is the name of your network group. It is important that both Samba and Windows are in the same workgroup. Please read your Windows documentation on how to change your Windows pc's workgroup name.
netbios name = Samba: netbios name is what you will see in your Windows pc "Network Neighborhood" for your Samba server.You can name this anything you wish. If you leave it blank, it will default to your host name.
encrypt passwords = yes: Samba can work with encrypted or unecrypted passwords. However, Windows 98, Windows NT, and Windows 2000 utilize encrypted passwords. The only time that this should be set to no is when you have any older Windows systems running on your network ie: Windows 95, Windows 3.x. If this is the case you will have to do some registery modifications to your Windows 98, NT, 2000 to allow them to send unencrypted passwords accross the network. Not the most secure situation though.
#global parameters
workgroup=home
netbios name=samba
encrypt passwords=yes
[homes] When you create a user on your Linux pc (more on this later) it will automatically create a home folder for you in /home/yourusername. Think of this as your "My Documents" for Linux.
read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browseable = no: defines when you map a network drive to Samba, it will map directly to your user directory ie: \\home\mw (this is my username on Linux and Samba) This share /homes/mw is browseable only by you. Remember this is much the same as the "My Documents" folder in Wndows
[share] This will create a share that is viewable, and writeable by anyone. This is not at all a secure share. Anyone can do whatever they wish, including deleting files that are not their own. I strongly do not recommend this type of sharing. I have given this example for illustrative reasons only.
path = /srv/samba/share: This tells us the directory is found on the Samba server as/srv/samba/share, and that when we will map the network drive it will be seen as "share" in Network Neighborhood
***To make this directory open a terminal window and type in md /srv/samba/share. Or this can be done from a file manager
read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browesable = yes: This share will show in in Network Neighborhood as "share"
[rajendran]
same as share configuration
# Shared Parameters
[homes]
read only=no
browseable=yes
[share]
path=/srv/samba/share
browseable=yes
public=yes
[rajendran]
path=/srv/samba/rajendran
browseable=yes
public=yes
Adding Users and Restarting Samba
root@boss[~]#smbpasswd -a chamy
New SMB password:
Retype new SMB password:
restart the samba service
root@boss[~]#/etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.
check whether samba is active or not
root@boss[~]#smbclient -L //samba -U chamy%chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]
Sharename Type Comment
--------- ---- -------
homes Disk
share Disk
IPC$ IPC IPC Service (Samba 3.5.6)
chamy Disk Home directory of chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]
Server Comment
--------- -------
SAMBA Samba 3.5.6
Workgroup Master
--------- -------
HOME SAMBA
Now the directory specified on the smb.conf are shares across the network
This is worked for me.
[global] Anything in here applies to Samba as a global setting. There is some configuration info here that is important so that Samba and your Windows pc's will function properly. However some global settings can be overridden by share settings (more on this later). I will now go through each line and give a brief description of what role it plays in Samba.
workgroup = home: this is the name of your network group. It is important that both Samba and Windows are in the same workgroup. Please read your Windows documentation on how to change your Windows pc's workgroup name.
netbios name = Samba: netbios name is what you will see in your Windows pc "Network Neighborhood" for your Samba server.You can name this anything you wish. If you leave it blank, it will default to your host name.
encrypt passwords = yes: Samba can work with encrypted or unecrypted passwords. However, Windows 98, Windows NT, and Windows 2000 utilize encrypted passwords. The only time that this should be set to no is when you have any older Windows systems running on your network ie: Windows 95, Windows 3.x. If this is the case you will have to do some registery modifications to your Windows 98, NT, 2000 to allow them to send unencrypted passwords accross the network. Not the most secure situation though.
#global parameters
workgroup=home
netbios name=samba
encrypt passwords=yes
Share Parameters
read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browseable = no: defines when you map a network drive to Samba, it will map directly to your user directory ie: \\home\mw (this is my username on Linux and Samba) This share /homes/mw is browseable only by you. Remember this is much the same as the "My Documents" folder in Wndows
[share] This will create a share that is viewable, and writeable by anyone. This is not at all a secure share. Anyone can do whatever they wish, including deleting files that are not their own. I strongly do not recommend this type of sharing. I have given this example for illustrative reasons only.
path = /srv/samba/share: This tells us the directory is found on the Samba server as/srv/samba/share, and that when we will map the network drive it will be seen as "share" in Network Neighborhood
***To make this directory open a terminal window and type in md /srv/samba/share. Or this can be done from a file manager
read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browesable = yes: This share will show in in Network Neighborhood as "share"
[rajendran]
same as share configuration
# Shared Parameters
[homes]
read only=no
browseable=yes
[share]
path=/srv/samba/share
browseable=yes
public=yes
[rajendran]
path=/srv/samba/rajendran
browseable=yes
public=yes
Adding Users and Restarting Samba
root@boss[~]#smbpasswd -a chamy
New SMB password:
Retype new SMB password:
restart the samba service
root@boss[~]#/etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.
check whether samba is active or not
root@boss[~]#smbclient -L //samba -U chamy%chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]
Sharename Type Comment
--------- ---- -------
homes Disk
share Disk
IPC$ IPC IPC Service (Samba 3.5.6)
chamy Disk Home directory of chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]
Server Comment
--------- -------
SAMBA Samba 3.5.6
Workgroup Master
--------- -------
HOME SAMBA
Now the directory specified on the smb.conf are shares across the network
This is worked for me.
Thursday, June 16, 2011
Using NFS Sharing the Directory in a LAN
NFSv4 server
NFSv4 exports exist in a single pseudo filesystem, where the real directories are mounted with the --bind option.
# mkdir -p /export/users
# mount --bind /home/chamy /export/users
/home/users /export/users none bind 0 0
/etc/default/nfs-kernel-server
/etc/default/nfs-common
NEED_SVCGSSD=no # no is default
NEED_IDMAPD=yes NEED_GSSD=no # no is default
In order for the ID names to be automatically mapped, both the client and server require the /etc/idmapd.conf file to have the same contents with the correct domain names. Furthermore, this file should have the following lines in the Mapping section:
[Mapping] Nobody-User = nobody Nobody-Group = nogroup
However, the client may have different requirements for the Nobody-User and Nobody-Group. For example on RedHatvariants, it's nfsnobody for both. Cat /etc/passwd and cat /etc/group should show the "nobody" accounts.
[Translation] Method = nsswitch
This will cause idmapd to know to look at nsswitch.conf to determine where it should look for credential information (and if LDAP authentication already working, nsswitch shouldn't require further explanation).
/export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async) /export/users 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
NFSv4 client
NEED_IDMAPD=yes NEED_GSSD=no # no is default
mount.nfs4: No such device
# modprobe nfs
nfs-server or ipaddress:/ /mnt nfs4 _netdev,auto 0 0
The auto option mounts on startup and the _netdev option waits until system network devices are loaded. However this will not work withWiFi as WiFi is set up at the user level (after login) not at system startup. If user use _netdev with WiFi the boot process will pause waiting for the server to become available.
Note that _netdev only works with nfs version 3 and before. nfs4 ignores this option. Depending on how fast the network comes up on boot the mount entry may fail and the system will just keep booting. It can still be useful if user make own script to wait for the network to come up and then mount -a -O _netdev
Server doesn't come with any init.d/netfs or other scripts to do this for user.
Tuesday, June 7, 2011
Getting lines from the matching Line in BOSS GNU/Linux
To get the lines after from matching line use following pattern
input-text | grep -A NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -A 4 "Jun 8"
2:
To get the lines before from matching line use following pattern
input-text | grep -B NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -B 4 "Jun 8"
input-text | grep -A NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -A 4 "Jun 8"
2:
To get the lines before from matching line use following pattern
input-text | grep -B NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -B 4 "Jun 8"
Subscribe to:
Posts (Atom)
Linux Kernel Compilation
Step 1: Install Required Packages Install additional packages before building a kernel. To do so, run this command: sudo apt-get install gi...
-
Step:1 sudo apt-get install python-pip Step:2 pip install -U selenium for python3 and more install Step:1 sudo apt-get...
-
This process will common for all HP Printers like HP LJ P 1007, P1020,P1020 plus,1022,3050 MFP, M 5035 MFP,P 2015N and Configuring the HP ...
-
Global Parameters [global] Anything in here applies to Samba as a global setting. There is some configuration info here ...