How To Convert A File Into Loop Devices Or How To Delete Them In Redhat Linux Rhel4&5

In This Tutorial We Are Going To Learn How To Configure Or Convert A File Into Loop Device Or How To Delete Them In 5 Easy And Simple Steps

Step-1 Firstly We Have To Create A File

Here I Am Creating 4 Files Of 500 MB Then I Am Going To Convert Into A Loop Device Then I Will Show You How To Delete Them 

#dd if=/dev/zero of=a bs=1M count=500
#dd if=/dev/zero of=b bs=1M count=500
#dd if=/dev/zero of=c bs=1M count=500
#dd if=/dev/zero of=d bs=1M count=500

Here The 4 files Of 500MB IS Created Now We Have To Convert Them Into A Loop Device

Setp-2 Here Is The Coding Of Converting Into A Loop Device

losetup /dev/loop0 a  { For Creating A File Into A Loop Device}
losetup /dev/loop1 b
losetup /dev/loop2 c
losetup /dev/loop3 d

Now We Have To Check The File Of 500MB Is Converted Or Not Into A loop Device

Step-3 Here Is The Command You Can Check

#losetup -a

Our Portion Of Creating loop Device Is Complete Now How We Delete Them

Step-4 Here IS The Command Of Deleting The Loop Devices

#losetup -d /dev/loop0 
#losetup -d /dev/loop1
#losetup -d /dev/loop2
#losetup -d /dev/loop3

Now We Have To Delete The File Of 500MB Which We Created Before

Step-5 Here IS The Command Of Deleting The File 

#rm -rf a
#rm -rf b
#rm -rf c
#rm -rf d


This IS All How We Convert A File Into A Loop Device Or How To Delete Them

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s