Friday, December 2, 2011

How to mount smb/cifs network share on linux

Make sure you do this as root
Create a directory for mount point 
#mkdir /mnt/smb_share 
#mount -t cifs -o user=test //servernameorIP/share /mnt/smb_share 
It then prompts for your Fileshare password. After successful mounting you can
list the content of the share
#ls /mnt/smb_share 


Monday, July 4, 2011

How to find out Gateway/Router IP address under Linux/Unix

Run route command
route -n

Output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.42.0       0.0.0.0         255.255.254.0   U     1      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         10.0.43.254     0.0.0.0         UG    0      0        0 eth0

10.0.43.254 is gateway IP address for the computer. The flag U indicates that route is up and G indicates gateway.

You can also run netstat command to find the gateway.
netstat -nr

Output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.42.0       0.0.0.0         255.255.254.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.0.43.254     0.0.0.0         UG        0 0          0 eth0



Tuesday, June 14, 2011

No init found . Try passing init = boot arg

Problem:
No init found . Try passing init = boot arg . 
Busy Box v1.15.3 (Ubuntu 1:1.15.3-1ubuntu 5)built-in shell (ash) 
Enter 'help' for a list of built-in commands. 
(initramfs)

One possible solution: 
1. Boot from the Ubuntu Live CD.
2. Open/Run Terminal.
3. Type: sudo fdisk -l (to get the device name) then press ENTER.
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: **********

Device Boot Start End Blocks Id System
/dev/sda1 * 1 30238 242886703+ 83 Linux
/dev/sda2 30239 30401 1309297+ 5 Extended
/dev/sda5 30239 30401 1309266 82 Linux swap / Solaris


4. Type: sudo fsck /dev/sda1 then press ENTER.
5. Restart the system and boot normally.