Subscribe:

Ads 468x60px

Pages

Showing posts with label Filesystem. Show all posts
Showing posts with label Filesystem. Show all posts

Friday, August 19, 2011

Linux ext3 filesystem: Deleting files won't free space -- at 100% disk usage

We've had our / filesystem used 100% with 0 bytes available. To free up some space, we've deleted a whole bunch of files, but df still reports there are 0 bytes available. Rebooting the system did not have any effect.

Apparently, the system starts to reserve space for system use. The tune2fs command reports current filesystem usage.

To see how much space is reserved, run

# tune2fs -l /dev/VolGroup00-LogVol00

To reset the reserved space to zero, run the following command as a root user.

# tune2fs -r 0 /dev/mapper/VolGroup00-LogVol00

By running the command above, we were able to free the space available for the linux users to use.
Read more...

Auto Mount NTFS/FAT23 in Ubuntu


This how you can mount windows partitions in ubuntu. You can only read NTFS but you can read and write on FAT32.

1. Run this command to see what partitions are NTFS/FAT32: sudo fdisk -l
# fdisk -l

2. Create a new directory to mount the partition to: 
# mkdir /mnt/windows

3. Backup /etc/fstab: 
# cp -rvfp /etc/fstab /etc/fstab_backup

3. Edit /etc/fstab:
#vim /etc/fstab
## Copy this line to the end of the file and change hd1 with the correct windows partition ##
## For NTFS ##
/dev/hda1 /media/windows ntfs nls=utf8,umask=0222 0 0
## For FAT32 ##
/dev/hda1 /media/windows vfat iocharset=utf8,umask=000 0 0
4. save and quit
:wq

The next time you restart ubuntu, it will mount automatically. 
Read more...

Wednesday, August 17, 2011

Configure ISCSI target and ISCSI initiator in linux server

In my lab setup, I have a host named server1.example.com, with an IP address of 192.168.1.112, which runs RHEL 6. This will be my iSCSI Target. A second host, named client1.example.com (192.168.1.11), which is also running RHEL 6, will be the iSCSI initator. 


Solution:
Open-iSCSI project software feature are high-performance, transport independent, multi-platform implementation of RFC3720 iSCSI


Step to configure the iSCSI Target:
Creating the iSCSI Target
install scsi-target-utils
[root@server1 ~]# yum install scsi-target -y


Start the tgtd service
[root@server1 ~]# service tgtd start


Make the service persistent after reboots
[root@server1 ~]# chkconfig tgtd on


Note: The tgtd service hosts SCSI targets and uses the iSCSI protocol to enable communications between targets and initiators. 

we need storage device to use as a target. 1.Create an LVM volume and 2. Create file-based images


1. Create an LVM volume
[root@server1 ~]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux


Create a raw partition
[root@server1 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)


Command (m for help): n
First cylinder (978-1044, default 978):
Using default value 978
Last cylinder or +size or +sizeM or +sizeK (978-1044, default 1044): +200M


Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 8e
Changed system type of partition 6 to 8e (Linux LVM)


Command (m for help): p


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux
/dev/sda6             978        1002      200781   8e  Linux LVM


Command (m for help): w
The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


[root@server1 ~]# partx -a /dev/sda


Create physical volume
[root@server1 ~]# pvcreate /dev/sda6
  Physical volume "/dev/sda6" successfully created


Create volume group
[root@server1 ~]# vgcreate vol01 /dev/sda6
  Volume group "vol01" successfully created


Create logical volume
[root@server1 ~]# lvcreate -L 150M -n log01 vol01
  Rounding up size to full physical extent 152.00 MB
  Logical volume "log01" created


2. Create file-based images
Create a new directory to store the image file
[root@server1 ~]# mkdir -p /var/lib/tgtd/virtualization


Create an image named virtimage2.img with a size of 100M.
[root@server1 ~]# dd if=/dev/zero of=/var/lib/tgtd/virtualization/virtimage2.img bs=1M seek=100 count=0


Configure the correct SELinux context for the new image and directory.
[root@server1 ~]# restorecon -R /var/lib/tgtd


Check the SELinux context for the new image and directory.
[root@server1 ~]# ls -ldZ /var/lib/tgtd/
drwxr-xr-x  root root root:object_r:var_lib_t:s0       /var/lib/tgtd/


Note: Targets can be created by adding an XML entry to the /etc/tgt/targets.conf file. The target attribute requires an iSCSI Qualified Name (IQN), in the format:
   iqn.yyyy-mm.reversed.domain.name:OptionalIdentifierText
where:
   yyyy-mm represents the 4-digit year and 2-digit month the device was started (for example: 2011-08);
   reversed.domain.name is the hosts domain name in reverse. For example, server1.example.com, in an IQN, becomes com.example.server1; and
   OptionalIdentifierText is any text string, without spaces, that helps the administrator identify which device is which.



Create the target
[root@server1 ~]# vim /etc/tgt/targets.conf
### At last add the following lines ###
<target iqn.2011-07.com.example.server1:trial>
backing-store /dev/vol01/log01                                     #LUN1
backing-store /var/lib/tgtd/virtualization/virtimage2.img   #LUN2
write-cache off
</target>


Save and quite
:wq


Note: Ensure that the /etc/tgt/targets.conf file contains the default-driver iscsi line to set the driver type as iSCSI (the driver uses iSCSI by default, but make sure that line is not commented out).
[root@server1 ~]# grep default-driver /etc/tgt/targets.conf
default-driver iscsi


IPTables configuration:
[root@server1 ~]# iptables -I INPUT -m tcp -p tcp --dport 3260 -j ACCEPT
[root@server1 ~]# service iptables save
[root@server1 ~]# service iptables restart


verify the new iscsi target
[root@server1 ~]# tgt-admin --show
Target 1: iqn.2011-07.com.example.server1:trial
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB
            Online: Yes
            Removable media: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 159 MB
            Online: Yes
            Removable media: No
            Backing store type: rdwr
            Backing store path: /dev/vol01/log01
            Backing store flags:
        LUN: 2
            Type: disk
            SCSI ID: IET     00010002
            SCSI SN: beaf12
            Size: 105 MB
            Online: Yes
            Removable media: No
            Backing store type: rdwr
            Backing store path: /var/lib/tgtd/virtualization/virtimage2.img
            Backing store flags:
    Account information:
    ACL information:
        ALL

Note: LUN 0 will appear as a device of type "controller". And also notice that the ACL list is set to ALL. This allows all systems on the local network to access this device.






Step to configure the ISCSI-initiator:


Install ISCSI-initiator
[root@server1 ~]# yum install iscsi-initiator -y


Start the iscsi service
# service iscsid start


Make the service persistent after reboots
[root@server1 ~]# chkconfig iscsid on


Now we can test whether the new iSCSI device is discoverable from client1.example.com:


[root@server1 ~]# iscsiadm -m discovery -t sendtargets -p server1.example.com
192.168.1.112:3260,1 iqn.2011-07.com.example.server1:trial
or
[root@server1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.112
192.168.1.112:3260,1 iqn.2011-07.com.example.server1:trial


Note: 192.168.1.112 is the ip address of your own iscsi target server


To view more information about your iSCSI Target
[root@server1 ~]# iscsiadm -m node -T iqn.2011-07.com.example.server1:trial -p 192.168.1.112
# BEGIN RECORD 2.0-872
node.name = iqn.2011-07.com.example.server1:trial
node.tpgt = 1
node.startup = automatic
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
node.discovery_address = 192.168.1.112
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.auth.authmethod = None
node.session.auth.username = <empty>
node.session.auth.password = <empty>
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 192.168.1.112
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD


Log into the iSCSI target
[root@server1 ~]# iscsiadm -m node -T iqn.2011-07.com.example.server1:trial -p 192.168.1.112 -l
Logging in to [iface: default, target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260]
Login to [iface: default, target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260] successful.


Check the logs for disk partion name is available
[root@server1 ~]# tail -f /var/log/messages
Aug 17 02:03:46 server1 kernel: scsi2 : iSCSI Initiator over TCP/IP
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: Controller        Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   RAID                               ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: scsi 2:0:0:0: Attached scsi generic sg1 type 12
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: VIRTUAL-DISK      Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: SCSI device sdb: 311296 512-byte hdwr sectors (159 MB)
Aug 17 02:03:46 server1 kernel: sdb: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdb: drive cache: write through
Aug 17 02:03:46 server1 kernel: SCSI device sdb: 311296 512-byte hdwr sectors (159 MB)
Aug 17 02:03:46 server1 kernel: sdb: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdb: drive cache: write through
Aug 17 02:03:46 server1 kernel:  sdb: unknown partition table
Aug 17 02:03:46 server1 kernel: sd 2:0:0:1: Attached scsi disk sdb
Aug 17 02:03:46 server1 kernel: sd 2:0:0:1: Attached scsi generic sg2 type 0
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: VIRTUAL-DISK      Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: SCSI device sdc: 204800 512-byte hdwr sectors (105 MB)
Aug 17 02:03:46 server1 kernel: sdc: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdc: drive cache: write through
Aug 17 02:03:46 server1 kernel: SCSI device sdc: 204800 512-byte hdwr sectors (105 MB)
Aug 17 02:03:46 server1 kernel: sdc: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdc: drive cache: write through
Aug 17 02:03:46 server1 kernel:  sdc: unknown partition table
Aug 17 02:03:46 server1 kernel: sd 2:0:0:2: Attached scsi disk sdc
Aug 17 02:03:46 server1 kernel: sd 2:0:0:2: Attached scsi generic sg3 type 0
Aug 17 02:03:46 server1 iscsid: Could not set session1 priority. READ/WRITE throughout and latency could be affected.
Aug 17 02:03:46 server1 iscsid: Connection1:0 to [target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260] through [iface: default] is operational now


Note: Now the target is enabled to be accessed upon reboots (persistent) and it's added to a node database in /var/lib/iscsi


Check the partition table
[root@server1 ~]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux
/dev/sda6             978        1002      200781   8e  Linux LVM


Disk /dev/sdb: 159 MB, 159383552 bytes
5 heads, 61 sectors/track, 1020 cylinders
Units = cylinders of 305 * 512 = 156160 bytes


Disk /dev/sdb doesn't contain a valid partition table


Disk /dev/sdc: 104 MB, 104857600 bytes
4 heads, 50 sectors/track, 1024 cylinders
Units = cylinders of 200 * 512 = 102400 bytes


Disk /dev/sdc doesn't contain a valid partition table



Create partition Disk
[root@server1 ~]# fdisk /dev/sdc
p              -->Print partition
n              -->Create new partition
p              -->Primary partition
2              -->partition Number
Enter        -->starting cylinder
+100M    -->size of the partition
p              -->Print partition
w              -->Write and save the partition


Reboot or refresh the kernel partition table by using partx command
[root@server1 ~]# partx -a /dev/sdb


Format Disk
[root@server1 ~]# mkfs.ext3 /dev/sdb2


create directory /iscsidata
[root@server1 ~]#mkdir /iscsidata


mount disk(/dev/sdb) to mount point(/iscsidata)
[root@server1 ~]# mount /dev/sdb2 /iscsidata


check the the filesystem is mounted or not
[root@server1 ~]# df -h


Mount the partition at boot. create a enty in the /etv/fstab file
[root@server1 ~]# vim /etc/fstab
/dev/sdb2 /iscsidata ext3 _netdev 0 0


mount all the partition which is exists in the /etc/fstab
[root@server1 ~]# mount -a


check the the filesystem is mounted or not
[root@server1 ~]# mount | grep iscsi


check the disk
# df -h
Read more...

Tuesday, August 16, 2011

SAN on HP-UX

After create LUN on external storage, we want to connect server through fiber channel to SAN Switch. 


First we should plugged FC HBA card to server. View HBA version. Ex: AB379B.We need to check depot Fiber Channel that contain HBA’s driver.

# swlist | grep FibrChanl-01
FibrChanl-01 B.11.11.10 FibreChannel;HW=A6826A,A9782A,A9784A,AB378A/B,AB379A/B,AB465A,AD193A,AD194A


If we don’t have any depot installed, we should download depot from HP site. After this we install that depot.
# swinstall -s /tmp/FibrChanl-01_B.11.11.12_HP-UX_B.11.11_64.depot

Before we plugged the HBA card we should make sure we have it’s driver.
After we install driver, it’s safe to shutdown server and plugged HBA card.
After start the system, show the system hardware and all list disk device class.

# ioscan -nfCdisk
Class I H/W Path Driver S/W State H/W Type Description
==========================================================================
disk 6 0/2/1/0.1.0.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c10t0d1 /dev/rdsk/c10t0d1
disk 5 0/2/1/0.1.1.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c12t0d1 /dev/rdsk/c12t0d1
disk 3 0/3/1/0.2.0.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c14t0d1 /dev/rdsk/c14t0d1
disk 4 0/3/1/0.2.1.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c16t0d1 /dev/rdsk/c16t0d1
# diskinfo -b /dev/rdsk/c10t0d1 
SCSI describe of /dev/rdsk/c10t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c12t0d1 
SCSI describe of /dev/rdsk/c12t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c14t0d1 
SCSI describe of /dev/rdsk/c14t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c16t0d1
SCSI describe of /dev/rdsk/c16t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

From our config, we found 4 path through same LUN. So we only need to create physical volume only on one disk.
# pvcreate -f /dev/rdsk/c10t0d1

Create vgdata partition # mkdir /dev/vgdata

# mknod /dev/vgdata/group c 64 0×010000
( 0×010000 is the magic number and this number has last 4 digits as 0000. The first two digits have to be unique and the maximum limit is 10 )

Create Volume Group, we need to define pe_size(ex: 64 MB) and max_pe (ex: 35000)
# vgcreate -s 64 -e 35000 /dev/vgdata /dev/dsk/c10t0d1 /dev/dsk/c12t0d1 /dev/dsk/c14t0d1 /dev/dsk/c16t0d1

Display volume group vgdata
# vgdisplay vgdata
— Volume groups —
VG Name /dev/vgdata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 35000
VGDA 2
PE Size (Mbytes) 64
Total PE 15678
Alloc PE 0
Free PE 15678
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

We want to allocate all “Free PE” to logical volume, so we can get max size.Size = Free PE x PE size.

# expr 15678 \* 64
1003392

Create logical volume on disk
# lvextend -L 1003392 -n datalvol /dev/vgdata

Create file system for logical volume that you created
# newfs -F vxfs -o largefiles /dev/vgdata/datalvol

Mount logical volume
# mkdir /data
# echo “/dev/vgdata/datalvol /data vxfs delaylog 0 2″ >> /etc/fstab
# mount /dev/vgdata/datalvol /data

Show final volume group vgdata information.
# vgdisplay -v vgdata
— Volume groups —
VG Name /dev/vgdata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 35000
VGDA 2
PE Size (Mbytes) 64
Total PE 15678
Alloc PE 15678
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
— Logical volumes —
LV Name /dev/vgdata/datalvol
LV Status available/syncd
LV Size (Mbytes) 1003392
Current LE 15678
Allocated PE 15678
Used PV 1
— Physical volumes —
PV Name /dev/dsk/c10t0d1
PV Name /dev/dsk/c12t0d1 Alternate Link
PV Name /dev/dsk/c14t0d1 Alternate Link
PV Name /dev/dsk/c16t0d1 Alternate Link
PV Status available
Total PE 15678
Free PE 0
Autoswitch On

Read more...

Thursday, August 11, 2011

To mount cdrom in Linux


Create a mount point
# mkdir /media/data


Temporarliy mounting cdrom to mount point
# mount -t iso9660 /dev/sdc0 /media/data


Permanently mounting cdrom to mount point
# vim /etc/fstab
/dev/sdc0 /media/data iso9660 ro,user,noauto 0 0 
:wq


umounting cdrom
# umount /dev/sdc0


If unable to unmount the cdrom
# fuser -mk /dev/sdc0


To eject the cd from cdrom drive
# eject


Troubleshooting:
Testing for iso9660 filesystem is support or not in your linux system.


To search for loaded kernel modules with lsmod command or by reading a content of /proc/filesystem file
# cat /proc/filesystems | grep iso9660
or
# lsmod | grep iso9660

Read more...

Monday, August 8, 2011

change the permission for multiple files or folders at a time under any specific directory


How to change the permissions of all the directories under as specific directory at a time itself
# find $x -type d -exec chmod 755 {} \;


How to change the permissions of all the files under as specific directory at a time itself
# find $x -type f -exec chmod 644 {} \; 
Read more...

Thursday, August 4, 2011

Ext2 Vs Ext3 Vs Ext4



Ext2, Ext3 and Ext4 are all filesystems created for Linux. This article explains the following:
  1. High level difference between these filesystems.
  2. How to create these filesystems.
  3. How to convert from one filesystem type to another.



Ext2:
1.       Ext2 stands for second extended file system.
2.      It was introduced in 1993. Developed by Rémy Card.
3.      This was developed to overcome the limitation of the original ext file system.
4.      Ext2 does not have journaling feature.
5.      On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling.
6.      Maximum individual file size can be from 16 GB to 2 TB
7.      Overall ext2 file system size can be from 2 TB to 32 TB

Ext3
1)      Ext3 stands for third extended file system.
2)     It was introduced in 2001. Developed by Stephen Tweedie.
3)     Starting from Linux Kernel 2.4.15 ext3 was available.
4)     The main benefit of ext3 is that it allows journaling.
5)     Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.
6)     Maximum individual file size can be from 16 GB to 2 TB
7)     Overall ext3 file system size can be from 2 TB to 32 TB
8)     There are three types of journaling available in ext3 file system.
         ·         Journal – Metadata and content are saved in the journal.
        ·         Ordered – Only metadata is saved in the journal. Metadata are journaled only after    writing the content to disk. This is the default.
       ·         Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.

You can convert a ext2 file system to ext3 file system directly (without backup/restore).

Ext4
1)      Ext4 stands for fourth extended file system.
2)     It was introduced in 2008.
3)     Starting from Linux Kernel 2.6.19 ext4 was available.
4)     Supports huge individual file size and overall file system size.
5)     Maximum individual file size can be from 16 GB to 16 TB
6)     Overall maximum ext3 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).
7)     Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
8)     You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
9)     Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3.
10)  In ext4, you also have the option of turning the journaling feature “off”.
Read more...

Tuesday, August 2, 2011

Logical Volume Manager (LVM)


LVM is a Logical Volume Manager for the Linux operating system. There are now two version of LVM for Linux: 

  • LVM 1: LVM 2 uses the device mapper kernel driver. Device mapper support is in the 2.6 kernel tree and there are patches available for current 2.4 kernels. The version that is in the 2.4 series kernel. LVM 1 is a mature product that has been considered stable for a couple of  years. The kernel driver for LVM 1 is included in the 2.4 series kernels, but this does not mean that your 2.4.x kernel is up to date with the latest version of LVM.
  • LVM 2:  The latest and greatest version of LVM for Linux. LVM 2 is almost completely backward compatible with   volumes created with LVM 1. The exception to this is snapshots (You must remove snapshot volumes before upgrading to LVM 2).

Read more...

Mounting ISO image

Place the boot.iso image to the Destop and make mount to /mnt mount point.


Making temporary mounting to /mnt:
# mount -o loop -t iso9660 /root/Desktop/boot.iso /mnt

Read more...

Monday, August 1, 2011

Purpose of last+found Directory


1) last+found it will store corrupted or damage files when the unclean Power failure occur or system shutdown occur.


2) When we create the ext3 file system. 'lost+found' directory is created.
Under these directory if any of the file has been damaged or crash the files will be store under 'lost+found'.

Read more...

Tuesday, July 19, 2011

Trying to umount: device is busy

You can see that the device is busy, so check out who is using it.

Syntax: fuser [options] <mount_point> | <filesystem>
Options:
-c Checks the mounted file system
-k Kills processes using the file system
-m Shows all processes using the file system
-u Displays user IDs
-v Provides verbose output
Read more...

Monday, June 27, 2011

Description of /etc/fstab fields

There are 5 fields present in the /etc/fstab:

1. Label - Lists the device to be mounted.



2. Mount Point - The directory where the filesystem will be mounted.


3. Filesystem Format - Describes the filesystem type. Valid filesystem types include ext,ext2, ext3, ext4, swap, msdos, vfat, proc, tmpfs, is09660, nfs and smb.


4. Dump value - It should be either 0 or 1. A value of 1 means that data is automatically saved to disk by the dump command when you exit linux.data should be backed up (also called dumping) before a system shutdown or reboot occurs. This field commonly uses a value of 1. A value of 0 might be used if the file system is a temporary storage space for files, such as /tmp.


5. Filesytem check order - It determines the order that filesystem are checked by fsck during the boot process. The root directory (/) filesystem should be set to 1, and other local filesystems should be set to 2. Removable filesystems such as /mnt/cdrom should be set to 0, which means that they are not checked during the linux boot process.

Read more...

Wednesday, May 25, 2011

Creating swap file


To create 64MB swap file on your root partition
# dd if=/dev/zero of=/swapfile bs=1024 count=65536

Set up a Linux swap area
# mkswap /swapfile

Activate the swap file
# swapon /swapfile

To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file:
# vi /etc/fstab

Append following line:
/swapfile1 swap swap defaults 0 0

Verify swap is activated or not
# free -m


Please feel free to comment to make it more useful to everyone.
Read more...