Tuesday, 5 June 2012

How to create new partition on Linux


Here i create new partition on 4 setps:

Step #1 For create new partition used fdisk command;

Following command will list all detected hard disks:
root@manish.bhandari#] fdisk -l | grep '^Disk'

Output:
Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes

To partition the disk - /dev/sdb, enter:
root@manish.bhandari#] fdisk /dev/sdb

The basic fdisk commands you need are:
  • m - print help
  • p - print the partition table
  • n - create a new partition
  • d - delete a partition
  • q - quit without saving changes
  • w - write the new partition table and exit
for avoid to reboot the system type this command;

root@manish.bhandari#] partprobe

Step #2 Format the new disk partition using mkfs.ext3 or mkfs.ext4 command;

root@manish.bhandari#] mkfs.ext4 /dev/sdb1

Step #3 Mount the new partition using command but first you create mount point /manish and mount command to mount /dev/sdb1;

root@manish.bhandari#] mkdir /manish

root@manish.bhandari#] mount /dev/sdb1 /manish

root@manish.bhandari#] df -h

Step #4 Update /etc/fstab file for parment mount;

root@manish.bhandari#] vim /etc/fstab

/dev/sdb1                           /manish                           ext4                defaults           1   2


Thanks & Regards
                                                                                                                     Manish Bhandari

Friday, 1 June 2012

How to mount iso image in Linux

Q How to mount iso image in linux

 Ans root@manish.bhandari#] mount -o loop example.iso /mnt

        root@manish.bhandari#] ls /mnt

Now mount the iso permanently

root@manish.bhandari#] vim /etc/fstab

/iso/rhel-server-5.5-x86_64-dvd.iso /mnt        iso9660   loop          0 0



                                             That' s all

                                                                                                                    Thanks & Regards
                                                                                                                         Manish Bhandari