LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 02-13-2009, 07:38 AM   #1
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Rep: Reputation: 32
I don't understand partitioning in Linux


OK, so i have installed Ubuntu and i now have one partition and it's mount point is /
Later, i used gParted (partitioning soft) to make another partition and it's mount point is /media/other

Now I have 2 partitions but i think that my other partition belongs to my first partition because it's located in my first partition. My first partition is in / and my other is in /media/other and so if i would delete my first partition then my other partition would also get deleted because it was in the first partition..

It's not like that on Windows.. If i have C:\ partition and i have D:\ partition and if i delete C:\ partition the D:\ partition would not get deleted..

OK, am i right?? Can someone make things clear for me?
 
Old 02-13-2009, 08:02 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
Do no mix two different things:
- partition a disk is like cutting a cake in slices -- though hopefuly you usually do not eat your partitions
- mount a partition is associating a device (often, but not always, a disk partition) to a directory in you file system's hierarchy, in order to be able to access it (mainly, read or write files on it).

gparted is mainly used to partition (cut in slices) your disk(s) as well as resizing or deleting existing partitions and format it (set up a file system in it).

Once done it's up to your system to mount these partition.

So the same (from a physical standpoint) partition can be labeled or mounted as C: on Windows, or /mnt/fat-c (or whatever else) on Linux.

To check your partitions you can for instance type as root:
Code:
fdisk -l
To see which are actually used (mounted) and on which directory:
Code:
df  -h
To see which mount point are recorded:
Code:
cat /etc/fstab
The /etc/fstab file is used by the system to know which partitions should be mounted at startup, and on which directories, as well as to ease usage of the 'mount' command by regular (unprivileged) users.

Last edited by Didier Spaier; 02-13-2009 at 08:26 AM. Reason: Typo
 
Old 02-13-2009, 08:02 AM   #3
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
UNIX and Linux disk partitions are like Windows in one respect. When you look at the properties of a disk partition in Windows you can select one of several options to make the partition useful. One option is to have the partition show up as a letter of the alphabet. Another option is to have the partition mounted on a directory. The last option is to have the partition *not* automatically visible anywhere. For example you can have a disk partition in Windows mounted as drive F or you can mount it on a directory such as C:\Documents and Settings\Owner\Documents.

UNIX and Linux are like the second and third options for Windows partitions. You mount a disk partition on a directory. The first partition is mounted on the top level. Other partitions except for swap partitions are mounted on directories under the top level directory.

Last edited by stress_junkie; 02-13-2009 at 08:04 AM.
 
Old 02-13-2009, 08:19 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
You are kinda right about one thing though. If you run a recursive delete operation on a directory, and that directory contains a mounted subdirectory tree located on a different partition, you would probably end up deleting the data on that partition as well. This is because in *nix the physical devices are (for the most part) irrelevant to the relative file structure itself; everything is seen as being one big tree, no matter how it's partitioned out.

Note that this is talking about the data on the partition though. You wouldn't be affecting the actual partition itself.
 
Old 02-13-2009, 08:23 AM   #5
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by Didier Spaier View Post
- mount a partition is associating a device (often, but not always, a disk partition) to a directory in you file system's hierarchy, in order to be able to access it (mainly, read or write files on it).
But i made a new partition with gParted and i didn't mount it.. how come i can access it then??
 
Old 02-13-2009, 08:39 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
Quote:
Originally Posted by QueenZ View Post
But i made a new partition with gParted and i didn't mount it.. how come i can access it then??
To acess it, it has to be mounted.

his can be done two ways:
- automatically at startup if there is a line for it in /etc/fstab with the relevant options
- manually using the 'mount' command.

If you use some software like HAL and dbus you can set up your system so that partitions on a removable hard disk (with an USB link) be automatically mounted when you plug in the device; but this is a bit out of topic.

Please send the output of following commands (the first one should be typed as root):
Code:
fdisk -l
df -h
cat /etc/fstab
so I will be able to give you precise examples.
 
Old 02-13-2009, 08:47 AM   #7
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
Well it says it's mounted on /media/other but i guess that gParted did all this mounting for me
 
Old 02-13-2009, 08:53 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
Quote:
Originally Posted by QueenZ View Post
Well it says it's mounted on /media/other but i guess that gParted did all this mounting for me
Nope, unless by gParted you mean the distribution on the live cd. But it can have been automatically mounted inside Gnome (or KDE) using HAL and dbus as previously stated. To make sure, could you send the output that I asked for in my last post ?
 
Old 02-13-2009, 08:56 AM   #9
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,787

Rep: Reputation: 211Reputation: 211Reputation: 211
Access

By access do you mean that you can see it with the command fdisk -l or with gparted? If a partition exists it should be detectable as such.

Post the results of the three commands suggested by Didier and you might get more of an explanation. You might also read this.

http://www.linux.org/lessons/beginner/l2/lesson2b.html

Good Luck
 
Old 02-19-2009, 07:35 AM   #10
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
What is the difference between

Mountpoint (/)
Partition (/dev/sda2)
GRUB Partition (hd0,1)
Device (/dev/sda)
GRUB Device (hd0)
and
UUID

?
 
Old 02-19-2009, 08:03 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
QueenZ;
I'm seeing a pattern in your posts--wherein you go off in different directions without responding to advice and requests for more info. You may want to consider staying a bit more focussed.....

Partition: A physical portion of the hard disk (or any block device--eg flash card)

/dev/xxx: The "files" in /dev are the portal to the real hardware device. (Keep in mind the Unix mantra that "everything is a file")

Mountpoint: The node in the directory tree where you mount (connect) a filesystem. (See my comment in one of your other threads.) (filesystems live on partitions)


I don't understand the GRUB questions in this context. If it helps, note that the GRUB notation for devices is different. Harddrives are always hdX, partitions are hdX,Y, and numbering starts at zero.
 
Old 02-19-2009, 08:06 AM   #12
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: Mepis; Maemo; openSUSE
Posts: 384
Blog Entries: 74

Rep: Reputation: 81
This may start answering some of the above questions.
 
Old 02-19-2009, 01:25 PM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Quote:
Originally Posted by QueenZ View Post
What is the difference between

1- Mountpoint (/)
2- Partition (/dev/sda2)
3- GRUB Partition (hd0,1)
4- Device (/dev/sda)
5- GRUB Device (hd0)
and
6- UUID

?
1- an arbitrary location used to connect a filesystem to a directory tree to allow reading and writing from it.

2- a useable (as well as unuseable) space on a hard disk drive that has been sectioned off for a particular use.

3- a way for boot loaders to reference hard disk drive prior to an operating system's kernel being loaded. pretty much how the bios maps to peripherals.

4- refers to a physical hard disk drive. each hard disk drive has at least 1 partition.

5- a way for a boot loader to detect the presence of a physical disk without the use of more elaborate software (operating system).

6- a globally unique serial number that is useful when the physical connection (ide or sata) changes on a computers mainboard. since the operating system refers to the device by the manufacturers serial number there is no need to modify configuration files (fstab).

Last edited by schneidz; 02-19-2009 at 01:29 PM.
 
Old 02-21-2009, 06:23 PM   #14
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
hmm.. but what if i want to search in my / partition?
My 'other' partition is in /media/other and it's in / partition..
 
Old 02-21-2009, 06:46 PM   #15
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
find / -name 'filename' would search the entire directory tree for 'filename' including any mounted volumes

windows handles partitions differently by assigning arbitray 'drive letters' to a partition, usually the main partition with the os is c: and every other partition, cd/dvd-rom, removable media such as a thumb drive or usb disk would be d: and above and floppies are hardcoded to use a: and b:
this may appear to be simple but is actually very bad because if your os is mounted as d: and something tries to install a software that is hardcoded to use c: then yer outa luck

linux organizes everything as a directory tree starting with / and any cd, floppy, partition, removable media etc.. is inserted into a mount point which is a directory under that tree, thus keeping the directory structure consistent so it doesn't matter which partition is / etc.. its always organized in the same way logically in the tree so if you install a program it always goes in the right place regardless of your partition configuration

Last edited by frieza; 02-21-2009 at 06:51 PM.
 
  


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
How to Understand Linux Patches sbc Linux - Newbie 1 01-21-2009 09:31 PM
I don't understand Linux AT ALL scott123 Linux - Newbie 2 10-29-2006 12:06 AM
Help me understand linux! Sideburnz Linux - Newbie 12 03-29-2006 04:37 PM
Trying to understand linux quintino Linux - Newbie 3 02-02-2002 05:35 PM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration