Monday, December 30, 2013

Linux Show List Of Network Cards

 Linux Show List Of Network Cards












lspci command

Type the following command:
# lspci | egrep -i --color 'network|ethernet'
Sample outputs:
09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5761e Gigabit Ethernet PCIe (rev 10)
0c:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300

lshw command

The lshw command can extract detailed information on the hardware configuration of the machine including network cards. Type the following command:
# lshw -class network
Sample outputs:
  *-network DISABLED
       description: Wireless interface
       product: Ultimate N WiFi Link 5300
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:0c:00.0
       logical name: wlan0
       version: 00
       serial: 00:21:6a:ca:9b:10
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-0.bpo.1-amd64 firmware=8.83.5.1 build 33692 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn
       resources: irq:46 memory:f1ffe000-f1ffffff
  *-network
       description: Ethernet interface
       product: NetXtreme BCM5761e Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:09:00.0
       logical name: eth0
       version: 10
       serial: b8:ac:6f:65:31:e5
       size: 1GB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.121 duplex=full firmware=5761e-v3.71 ip=192.168.1.5 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
       resources: irq:48 memory:f1be0000-f1beffff memory:f1bf0000-f1bfffff

ifconfig and ip command

To see all configured network devices, enter:
# ifconfig -a
OR
# ip link show
OR
# ip a
Sample outputs:
1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::baac:6fff:fe65:31e5/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0:  mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:21:6a:ca:9b:10 brd ff:ff:ff:ff:ff:ff
4: pan0:  mtu 1500 qdisc noop state DOWN
    link/ether 92:0a:e7:31:e0:83 brd ff:ff:ff:ff:ff:ff
5: vmnet1:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.1/24 brd 192.168.121.255 scope global vmnet1
    inet6 fe80::250:56ff:fec0:1/64 scope link
       valid_lft forever preferred_lft forever
6: vmnet8:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
    inet 192.168.179.1/24 brd 192.168.179.255 scope global vmnet8
    inet6 fe80::250:56ff:fec0:8/64 scope link
       valid_lft forever preferred_lft forever

/proc/net/dev

The dev pseudo-file contains network device status information. This gives the number of received and sent packets, the number of errors and collisions and other basic statistics.
$ cat /proc/net/dev
Sample outputs:
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:   20097     179    0    0    0     0          0         0    20097     179    0    0    0     0       0          0
vmnet8:       0       0    0    0    0     0          0         0        0      33    0    0    0     0       0          0
  pan0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 wlan0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth0: 592509534  623058    0    0    0     0          0      1053 122269656  401567    0    0    0     0       0          0
vmnet1:       0       0    0    0

Sunday, December 15, 2013

Linux Backup tools



Linux backup Tools :
S.No
Name
1
fwbackup
2
Bacula
3
Rsync
4
Simple backup Solution
5.
Mondo Rescue
6
Amanda
7
Arkeia
8
Back in Time
9
Box Backup
10
Kbackup
11
RSnapshot
12
Clonezilla
13
PartImage
14
PING
15
Zmanda
16
FlyBack
17
Time Vault
18
Tar
19
Dump/restore
20
Duplicity
21
Cadar Backup
22
afbackup
23
Keep
24
Areca Backup
25
BackupPC
26
glasstree

Sunday, November 24, 2013

How to take backup from a remote machine in linux



 In this post Iam describing how to take backup or copy of a folder or directory from a remote machine that is connected to the network

Step 1 : Checking for SSH enabled

Look for SSH server is started by typing command #restart ssh


Step 2: selecting source and destination directories

Step 3: Using command line tool for taking backup

Here Iam transfering the data present in the machine 192.168.44.128 with username ubuntuserver /backup directory.this is done by command
 "rsync -avz username@remote_machine:/source folder  /destination folder "
 
root@ubuntu:~# rsync -avz ubuntuserver@192.168.44.128:/backup /media/disk1/Backup_03012013
ubuntuserver@192.168.44.128's password:
receiving incremental file list
created directory /media/disk1/Backup_03012013
backup/
backup/1/
backup/1/1233
backup/1/44
backup/1/5
backup/2/
backup/2/3444
backup/2/55
backup/3/
backup/3/4
backup/4/

sent 145 bytes  received 416 bytes  53.43 bytes/sec
total size is 0  speedup is 0.00

Saturday, November 23, 2013

Backing up files and folders on same system or server in linux

In this post Iam describing how to take backup of folders and files in linux local system or server. Here I used Ubuntu Linux as OS.

Step 1:Deciding source and destination directories

Decide which folder or directory that should be backed up . This directory will become the source directory. The directory in which the source files or folders must be kept.This directory is the destination directory.

Step 2: Mounting the Disk or external drive 

If the backup is the total system backup which can be in large size or very important , it should be stored in external devices or other partitions or hard disks, it should be mounted.

In this description I used another partion named /dev/sdc6 for storing backup

I mounted this on  /media/diskc1 using  command

root@ubuntu:~# mkdir /media/disk1
root@ubuntu:~# mount /dev/sdb2 /media/disk1


Step3 : Creating Backup directory or folder 

For storing the backup I created a directory called Backup_01012013.By using the following command

root@ubuntu:~# mkdir /media/disk1/Backup_01012013
root@ubuntu:~# ls -l /media/disk1
total 20
drwxr-xr-x 2 root root  4096 2013-11-23 10:50 Backup_01012013
drwx------ 2 root root 16384 2013-11-12 08:23 lost+found


Step4 : Creating backup using "rsync" command

Here Iam backing up a folder named "impfolder" in the users root directory by uising "remote synchronize " command

root@ubuntu:~# rsync -zvr impfolder /media/disk1/Backup_01012013
sending incremental file list
impfolder/
impfolder/f1
impfolder/f2
impfolder/f3
impfolder/f4

sent 356 bytes  received 92 bytes  896.00 bytes/sec
total size is 285  speedup is 0.64



Step6: Checking the backup in the destination directory 

By using "ls" command from the directory /media/disk1/Backup_01012013/

root@ubuntu:~# ls -l /media/disk1/Backup_01012013/impfolder
total 16
-rw-r--r-- 1 root root  20 2013-11-24 04:38 f1
-rw-r--r-- 1 root root 155 2013-11-24 04:38 f2
-rw-r--r-- 1 root root  22 2013-11-24 04:38 f3
-rw-r--r-- 1 root root  88 2013-11-24 04:38 f4
 


How to install Mozilla Firefox Web Browser in Ubuntu Linux






In this post I am describing how to install Mozilla Firefox browser in Ubuntu Linux

Step 1 :  Download Latest Firefox browser for linux from the Mozilla portal
                          Mozilla Firefox for Linux Download

Step 2 : Save the  " firefox-25.0.tar.bz2 " tar file in a specified      downloads          folder or Home folder    

Step 3 : Untar the file "firefox-25.0.tar.bz2"   using command 

                              #tar -xvf firefox-25.0.tar.bz2

Step 4  : Removing previous versions of firefox. By  search command 
                             #whereis firefox

               generally firefox resides in  /usr/bin/firefox
               remove this file or backup the firefox file by using command
                                 #cp /usr/bin/firefox  /usr/bin/firefox.bkp

Step 5 : After this make a soft link form the folder where we untared the    downloaded firefox using the following command as a shortcut in windows

                                  #ln -s /home/firefox-25.0/firefox  /usr/bin/firefox


Step6 : finally firefox can be accessed from firefox icon on "Applications /internet/firefoxweb browser "






Wednesday, November 13, 2013

Mounting and Unmounting file system or devices in Linux

Once you insert new hard disks into your system, you’ll typically use utilities like fdisk or parted to create partitions. Once you create a partition, you’ll use mkfs command to create ext2, ext3, or ext4 partition.
Once you create a partition, you should use mount command to mount the partition into a mount point (a directory), to start using the filesystem.
This tutorial explains everything you need to know about both mount and umount command with 15 practical examples.

The general mount command syntax to mount a device:
mount -t type device destination_dir

1. Mount a CD-ROM

The device file for CD would exist under /dev directory. For example, a CD-ROM device will be mounted as shown below.
# mount -t iso9660 -o ro /dev/cdrom /mnt
In the above example, the option “-o ro” indicates that the cdrom should be mounted with read-only access. Also, make sure that the destination directory (in the above example, /mnt) exist before you execute the mount command.

2. View All Mounts

After you execute mount a partition or filesystem, execute the mount command without any arguments to view all the mounts.
In the example below, after mounting the USB drive on a system, the output of mount looks like the below. As seen below, the USB device (i.e:/dev/sdb) is mounted on /media/myusb, which is displayed as the last line in the mount command.
# mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda6 on /mydata type ext2 (rw)
/dev/sda7 on /backup type vfat (rw)
gvfs-fuse-daemon on /home/bala/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bala)
/dev/sdb on /media/myusb type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
You can also use df command to view all the mount points.
# df
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda5      195069136 128345036  56958520  70% /
udev             2008336         4   2008332   1% /dev
tmpfs             806244       928    805316   1% /run
none                5120         0      5120   0% /run/lock
none             2015604       228   2015376   1% /run/shm
/dev/sda6       17729076    176200  16657596   2% /mydata
/dev/sda7       11707200    573312  11133888   5% /backup
/dev/sdb         3910656   2807160   1103496  72% /media/myusb

3. Mount all the filesystem mentioned in /etc/fstab

The filesystems listed in /etc/fstab gets mounted during booting process. After booting, system administrator may unmount some of the partitions for various reasons. If you want all the filesystems to be mounted as specified in /etc/fstab, use -a option with mount as shown below:
Example /etc/fstab file entries:
# cat /etc/fstab
#
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda5 during installation
/dev/sda5 /               ext4    errors=remount-ro 0       1
# /mydata was on /dev/sda6 during installation
/dev/sda6 /mydata         ext2    defaults        0       2
# /backup was on /dev/sda7 during installation
/dev/sda7 /backup         vfat    defaults        0       3
Execute mount command with -a option to mount all the /etc/fstab entries.
# mount -a

# mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda6 on /mydata type ext2 (rw)
/dev/sda7 on /backup type vfat (rw)
gvfs-fuse-daemon on /home/bala/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bala)
The same -a option can be used with umount to unmount all the filesystems mentioned in /etc/mtab
# umount -a
umount: /run/shm: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /run: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /dev: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
Some filesystem are not unmounted as its busy or currently in use. Note that the files /etc/mtab and /proc/mounts contents would be similar.

4. Mount only a specific filesystem from /etc/fstab

When you pass only the directory name to mount, it looks for mount point entries, if not found, then search continuous for a device in /etc/fstab and gets mounted.
# mount | grep /mydata

# cat /etc/fstab | grep mydata
##########/mydata was on /dev/sda6 during installation##########
 /dev/sda6 /mydata         ext2    defaults        0       2
As seen above, /mydata directory is not a mountpoint, but it is present in /etc/fstab.
# mount /mydata

# mount | grep /mydata
/dev/sda6 on /mydata type ext2 (rw)
If you execute the same again, you would get the error message as follows:
# mount /mydata
mount: /dev/sda6 already mounted or /mydata busy
mount: according to mtab, /dev/sda6 is already mounted on /mydata
Here you may also pass the device name instead of directory name (to be picked up from /etc/fstab file).
# mount /dev/sda6
Note that the files /etc/mtab and /proc/mounts contents would be similar.

5. View all mounted partitions of specific type

It is possible to list only the specific type of filesystem mounted using the option -l with -t as shown below:
# mount -l -t ext2
/dev/sda6 on /mydata type ext2 (rw)

# mount -l -t ext4
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
As seen above, /dev/sda6 is the only ext2 partition and /dev/sda5 is the only ext4 partition accordingly.

6. Mount a Floppy Disk

The device file for floppy disk would exist under /dev directory. For example, a floppy disk will be mounted as shown below.
# mount /dev/fd0 /mnt
# cd /mnt
After the successful mount, you would be able to access the contents of the floppy disk. Once you are done with it, use umount before you physically remove the floppy disk from the system.
# umount /mnt

7. Bind mount points to a new directory

The mountpoint can be binded to a new directory. So that you would be able to access the contents of a filesystem via more than one mountpoints at the same time.
Use -B option with olddir and newdir to be binded as follows,
# mount -B /mydata /mnt
Now the bind is done and you might verify it as follows,
# mount | grep /mydata
/dev/sda6 on /mydata type ext2 (rw)
/mydata on /mnt type none (rw,bind)
As seen above the bind is done properly. So when you do modification in filesystem in one place, you can see those reflection of it in other mount point as shown below:
# cd /mydata
# ls
test
# mkdir dir1
# mkdir dir2
# ls
test    dir1    dir2
# cd /mnt
# ls
test    dir1    dir2

8. Access contents from new mount point

Mount allows you to access the contents of a mount point from a new mount point. Its nothing but move a mounted tree to another place.
In the example below, the mount point /mydata will be accessed from /mnt using the option -M as shown below:
# mount -M /mydata /mnt/
Once its done, you cant use the old mount point as its moved to a new mount point and this can be verified as shown below:
# mount | grep /mydata
# mount | grep /mnt
/dev/sda6 on /mnt type ext2 (rw)

9. Mount without writing entry into /etc/mtab

During read only mount of /etc/, the /etc/mtab file entries cannot be modified by mount command. However, mount can be done without writing into /etc/mtab by using the option -n as follows,
# mount -n /dev/sda6 /mydata
You cannot see any entry for this /mydata in mount command output and as well from /etc/mtab file as follows:
# mount | grep /mydata
# cat /etc/mtab | grep /mydata
Access the contents of a mounted directory /mydata:
# cd /mydata
# ls
dir1  dir2  test

10. Mount filesystem with read or read/write access

To mount partition as read only, use -r option which is synonym to -o ro.
# mount /dev/sda6 /mydata -r
# mount  | grep /mydata
/dev/sda6 on /mydata type ext4 (ro)
ext3 and ext4 filesystem would still allow you to do write operation when the filesystem is dirty. So, you may have to use “ro,noload” to prevent these kind of write operation.
# mount /dev/sda6 /mydata -t ext4 -o ro -o noload
# mount | grep /mydata
/dev/sda6 on /mydata type ext4 (ro,noload)
To mount a partition with read/write access, use -w option which is same as “-o rw” (i.e : default).

11. Remount the mounted filesystem

In order to mount the already mounted filesystem, use remount option and its normally used to remount the filesystem with read/write access when its previously mounted with read access.
The /mydata mount point is going to be remounted with read/write access from read access as shown below:
# mount | grep /mydata
/dev/sda6 on /mydata type ext4 (ro,noload)
# mount -o remount,rw /mydata
# mount | grep /mydata
/dev/sda6 on /mydata type ext4 (rw)

12. Mount an iso image into a directory

The iso image can be mounted as shown below:
# mount -t iso9660 -o loop pdf_collections.iso /mnt
# cd /mnt
# ls
perl/    php/    mysql/

13. Unmount more than one mount points

Umount allows you to unmount more than mount point in a single execution of umount of command as follows:
# umount /mydata  /backup
# mount | grep /mydata
# mount | grep /backup

14. Lazy unmount of a filesystem

This is a special option in umount, in case you want to unmount a partition after disk operations are done. You can issue command umount -l with that partition and the unmount will be done after the disk operations gets finished.
For instance, consider a scenario that a task (i.e: script or any other command) is doing a copy operation on a disk and at the same time you are allowed to issue a unmount with -l, so that unmount would be done once the copy is over (i.e: the disk operation).
# umount /mydata -l

15. Forcefully unmount a filesystem

umount provides the option to forcefully unmount a filesystem with option -f when the device is busy as shown below:
# umount -f /mnt
If this doesn’t work for you, then you can go for lazy unmount.
Meanwhile, you can also have a look at ps command output that which process is presently using the mountpoint as shown below:
# ps ajx | grep /mydata
 2540  3037  3037  2468 pts/2     3037 D+       0   0:00 cp -r /home/geekstuff/ProjectData/ /mydata
You can also execute fuser command to find out which process is holding the directory for operations.
# fuser -cu /mydata
/mydata:              3087(root)
It gives you the process id with username (nothing but the owner of the process). If you know what that process is, you may want to stop that process and then try the umount again.

How to label or name a partition in linux

TO label or naming the Linux devices

To label the name of the harddisk partitions use the followig command line tool
"e2label " or "tune2fs -L "

here i labeled the ext4 file system of partition sdb1 with label "diskc" and sdb2 as "disk2"

root@ubuntu:~# e2label /dev/sdb1 diskc

root@ubuntu:~# tune2fs -L disk2 /dev/sdb2
tune2fs 1.41.14 (22-Dec-2010)



to display the label or name of the device

If the optional argument new-label is not present, e2label will simply display the current filesystem label.
 
root@ubuntu:~#e2label /dev/sdb1
diskc1
root@ubuntu:~# e2label /dev/sdb2
disk2

 


 

Tuesday, November 12, 2013

Formatting Linux system Hard Disks

step 1:
first check weather the disks are partitioned or not by the following command

"fdisk -l "  we can get the following information

#fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00068038

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1175     9436160   83  Linux
/dev/sda2            1176        1306     1046529    5  Extended
/dev/sda5            1176        1306     1046528   82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc0e14f21

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         605     4859631   83  Linux
/dev/sdb2             606        1305     5622750   83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf0bfae39

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         605     4859631   83  Linux
/dev/sdc2             606        1305     5622750    5  Extended
/dev/sdc5             800        1305     4064445   83  Linux
/dev/sdc6             606         799     1558273+  83  Linux

Partition table entries are not in disk order


step 2 : 

formating using mkfs tool 

#mkfs -t ext4 /dev/sdb1
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
351568 inodes, 1405687 blocks
70284 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1442840576
43 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables:  done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override. 


formatting sdb5 partition with ntfs format


#mkfs -t ntfs /dev/sdb5
Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes:  Done.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.

step 3 :
Checking all the partitions and their file system types

By using the command tool " blkid " we can get the file system type of all block devices that mounted or not mounted

#blkid
/dev/sda1: UUID="c99f3da5-e8a1-4236-ac74-5464b862fa2e" TYPE="ext4"
/dev/sda5: UUID="0323dd58-19bd-4c1b-84a0-5f11bfb09012" TYPE="swap"
/dev/sdb1: UUID="73bcc908-29ac-4f35-ac5d-a7f8ef129bc8" TYPE="ext4"
/dev/sdb2: UUID="9bb0643c-b44f-42aa-b421-c77982d62dc3" TYPE="ext4"
/dev/sdc1: UUID="47A5FD69713DD7A7" TYPE="ntfs"
/dev/sdc5: UUID="3CDB914277A4D94D" TYPE="ntfs"
/dev/sdc6: UUID="A561-50B5" TYPE="vfat" 


by using the command tool " parted " we can get detailed file system details of the mounted and unmounted file systems 

#parted -l
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  9664MB  9663MB  primary   ext4            boot
 2      9665MB  10.7GB  1072MB  extended
 5      9665MB  10.7GB  1072MB  logical   linux-swap(v1)


Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  4976MB  4976MB  primary  ext4
 2      4976MB  10.7GB  5758MB  primary  ext4


Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdc: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  4976MB  4976MB  primary   ntfs
 2      4976MB  10.7GB  5758MB  extended
 6      4976MB  6572MB  1596MB  logical   fat32
 5      6572MB  10.7GB  4162MB  logical   ntfs



Saturday, November 9, 2013

Partioning multiple hard disks in Linux


                           In this post I am  presenting here how to make partitions on a Linux installed System. The system first contains only one SCSI Hard Disk. It contains three partitions (sda1,sda2,sda5). These are default partitions when installing Linux on a system containing single hard disk. 
                         Here I am  adding 9 other SCSI Hard Disks to the system.After adding the disks I verified the system whether the system recognized these additional disks.By restarting the system and typing the command    "  #lsblk "  in the terminal.



Fig (1) displaying Partitions on a Linux System


The above fig(1) show the partitions present in the Linux system. The figure shows ten Hard Disks ( sda - sdj ) .The initial disk sda contains 3 partitions.The remaining nine does not show any information and partition details.Here the disks are only added .It neither formatted nor contains partition table.So to make the disk usable it must be formatted.
so the following command " fdisk " is used to format the disks one by one.





                          Fig (2) formating the disk sdb using fdisk command in linux

the following command " #fdisk /dev/sdb " is used to format the disk "sdb" here the below figure 3 shows the partition table and detail options to use fdisk


figure (3) showing partition table by using fdisk command in linux

As it doesn't show any partition details , I used "fdisk " 'n' option to create a partition. It will ask weather it is a primary partition or an existing partition. By default it makes a primary partition and next asks for partition number, first sector and last sector for the partitions.Finally the configuration changes are written by using option  'w' .The following figure 4 shows the partition phenomenon






figure (4) showing configuration options of partitioning disk using fdisk

finally the next eight disks are partitioned using fdisk command and block devices are listed by the lsblk command .The following figure 5 & 6 shows the listed block devices in the system



Figure 5 showing and listing block devices in linux system

Figure 6 Showing block devices in the linux system