LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-23-2010, 05:16 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 676
Blog Entries: 2

Rep: Reputation: 36
Help needed to understand partitions in linux


Hi guys,

It has been more than 2 month i switched to linux but i m still very much confused how linux handles and names the partitions.

I have gone through couple of beginners material and found linux doesnt treat partitions as c: and d: instead it uses /dev/hda1 /dev/hda2 hda3 .But now i have come across something like dev/sda1 dev/sda5 tmpfs

Please find output of df -h

PHP Code:
[root@test ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             3.9G  867M  2.9G  24% /
/
dev/sda1              99M   45M   49M  48% /boot
tmpfs                 285M     0  285M   0
% /dev/shm
/dev/sda5             1.1T  561G  544G  51% /var/ovs/mount/F179080BDBFD4C5596D03242EFE5179C 
I have few questions regarding the same.
1)Why there is no sda2 sda 4 present?
2)What is tmpfs ?
3)What is the difference between sda and hda
4)I also heard there is something as LVM.(How do i know whether my drives are LVM supported or not?
If they are supported how do i extend the drives.

I know these are pretty basic for advance user but i m still a learner in linux . Please help.

Last edited by pinga123; 04-23-2010 at 05:18 AM.
 
Old 04-23-2010, 05:20 AM   #2
linuxunix
Member
 
Registered: Mar 2010
Location: California
Distribution: Slackware
Posts: 235

Rep: Reputation: 18
Using ramfs or tmpfs you can allocate part of the physical memory to be used as a partition. You can mount this partition and start writing and reading files like a hard disk partition. Since you’ll be reading and writing to the RAM, it will be faster.

When a vital process becomes drastically slow because of disk writes, you can choose either ramfs or tmpfs file systems for writing files to the RAM.


Both tmpfs and ramfs mount will give you the power of fast reading and writing files from and to the primary memory. When you test this on a small file, you may not see a huge difference. You’ll notice the difference only when you write large amount of data to a file with some other processing overhead such as network.

Mounting tmfs:

# mkdir -p /mnt/tmp

# mount -t tmpfs -o size=20m tmpfs /mnt/tmp

The last line in the following df -k shows the above mounted /mnt/tmp tmpfs file system.


Ans:2 IDE hard disks (well, devices, actually) are hd<drive><partition>. SCSI devices (and kernel-level emulation of SCSI devices, like USB devices or, in some cases, CD-RW drives) are sd<drive><partition>.
The standard partitioning scheme nowadays is (assuming your drive is hda):
Code:
hda1 => bootloader and kernel(s)
hda2 => swap space
hda3 => root filesyste

Last edited by linuxunix; 04-23-2010 at 05:22 AM.
 
Old 04-23-2010, 05:33 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 676
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Using ramfs or tmpfs you can allocate part of the physical memory to be used as a partition. You can mount this partition and start writing and reading files like a hard disk partition. Since you’ll be reading and writing to the RAM, it will be faster.
Whatever i understand is following.
tmpfs is like a space of RAM Which you can use as partition.
This space is mostly used for processing where read and write jobs are very likely to happen.
I m still confused where would i need such space if it fasten the read write operations ?
What is difference between ramfs and tmpfs?



Quote:
Ans:2 IDE hard disks (well, devices, actually) are hd<drive><partition>. SCSI devices (and kernel-level emulation of SCSI devices, like USB devices or, in some cases, CD-RW drives) are sd<drive><partition>.
The standard partitioning scheme nowadays is (assuming your drive is hda):
Code:
hda1 => bootloader and kernel(s)
hda2 => swap space
hda3 => root filesyste
Looking at my configuration they all are sda So you mean my hard drive is sata there fore it is sda(Correct me if i m wrong?)

Last edited by pinga123; 04-23-2010 at 05:36 AM.
 
Old 04-23-2010, 05:48 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,531
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by pinga123 View Post
1)Why there is no sda2 sda 4 present?
df displays the mounted file systems. To display the partitions use a partition utility such as fdisk, cfdisk or gparted. Partitions do not have to contain file systems and even if they do they don't have to be mounted. Partitions without file systems are used for swap space and for LVM. The primary partitions are numbered 1 to 4 but may not all be present. Any logical partitions (that is partitions within a primary partition of type "extended") are numbered from 5 upwards. Depending on how the partitions have been created there may be gaps in the sequence.
Quote:
Originally Posted by pinga123 View Post
2)What is tmpfs ?
Already answered.
Quote:
Originally Posted by pinga123 View Post
3)What is the difference between sda and hda
The "s" in sda was for SCSI disks. The h in hda was for IDK what but it was used for IDE/EIDE/PATA disks. Recently (last year or so) Linux has started treaing IDE/EIDE/PATA/SATA/USB drives as if they were SCSI drives so they're all sd<something> now.
Quote:
Originally Posted by pinga123 View Post
4)I also heard there is something as LVM.(How do i know whether my drives are LVM supported or not?
LVM uses disk partitions as pools of storage space from which it creates logical (virtual) partitions. AFAIK LVM is not picky about the types of drives it uses for pools of storage space. LVM is most often used on servers; it is most advantageous when the system has to be up for long periods and when there are multiple disks. Most desktop Linux systems support LVM but few people see its complexity as justifying the benefits on a desktop. Its one great benefit on a desktop is that it provides snapshots thus allowing a "point in time" backup which can be verified.

Last edited by catkin; 04-23-2010 at 05:51 AM. Reason: speeling, typodynamics and sub-editing tyranny
 
Old 04-23-2010, 06:11 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,138

Rep: Reputation: 987Reputation: 987Reputation: 987Reputation: 987Reputation: 987Reputation: 987Reputation: 987Reputation: 987
There are some reasonably "deep" questions there - the answers are likely to confuse (more) as much as help.
As suggested above, post the output of "/sbin/fdisk -l", and we'll hopefully try to unconfuse you some.
 
Old 04-23-2010, 06:48 AM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,061
Blog Entries: 1

Rep: Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374Reputation: 1374
Hi,

'Linux File System' section of 'Slackware-Links' has links that should provide help for you to understand most of the presented questions.

Just a few more useful links;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Newbie Admin Guide
LinuxSelfHelp
Getting Started with Linux

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL5: fdisk -l returns: What does it mean? Wish to understand linux partitions. redhat5 Linux - Newbie 2 08-14-2009 12:37 PM
NEEDED NOW : How to read Linux RAID partitions ? johnlefevre Mandriva 19 10-10-2005 05:31 AM
NEEDED NOW : How to read Linux RAID partitions ? johnlefevre Linux - Newbie 4 10-08-2005 06:41 PM
i don't understand disc partitions! critical error! joel b Linux - Newbie 1 03-27-2005 04:45 PM
Types of HD partitions needed for installing Linux bperry Linux - Newbie 1 06-11-2002 08:45 PM


All times are GMT -5. The time now is 10:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration