LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-10-2005, 02:04 PM   #1
Dahak
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
Partition vs Mountpoint


I read and read about partition and mount points in Linux, but I'm still confused. I have 3 partitions on my machine. hda1 at /, hda2 at /boot, and hda3 at /home.

Do all files from /home and down belong to the 3rd partition?
If I the 2nd and 3rd partitions did not exist, would the folders still exist?

How do you tell what belongs to what partition?

I've just started with Linux, and I've want to reload from scratch. However, I also want to preserve a few of the files I downloaded in my User folder. Would I just reload the install CD and delete the first two partitions, and remount the 3rd partition at its old spot?

Running RH 9.0
 
Old 01-10-2005, 02:43 PM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
Here's how it goes. Partitions is physicaly divided space on your harddisk. A quick analogy to Windows as this is more easily understandable to people. In Windows, you have C: and D: and E: . These are partitions. Now you can imagine your harddisk being split in three pieces(it is not, it's just virtually divided). Partition is a virtually divided space on your harddisk. You can split an 80 GB harddisk into smaller partitions, like C: (20GB) D: (15GB) and E: (45GB). Now this is all the same in linux. Just that here partitions are identified by /dev/hda1, and /dev/hda2, and /dev/hdb1..... All you have to do is take the /dev/ part away and you can easily say where and what partition that name refers to. hd stands for hard disk and a stands for primary harddisk, and b stands for secondary harddisk.

So hda would be your primary harddisk
and hdb would be your secondary harddisk (presuming you have two harddisks in your computer)

now hda1 would mean that you are refering to the first partition on your primary harddisk (if you have windows on your computer, this would be C

hda2 would be the second partition on your primary harddisk and so on.... You get the idea?

Mountpoints in Linux is where the partition is mounted(like pluged in). If you mount your 3rd partition to /home then all the files in /home are from that 3rd partition as only one partition can be mounted on the same directory. However you could mount another partition on like /home/someotherpartition.

The easiest way to determine what belongs to what partition is to issue a mount command, which will tell you what partitions are mounted and where.

bash$> mount

Oh and if you are rebuilding from scratch, just don't touch the partition you want to hold for the new install and just mount it where you want later, whern you are finished with installing.
 
Old 01-10-2005, 05:10 PM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
marghop got it but in a shorter version, yes delete the first two partitions and when your installing usually the partioning part will let you specify hda3's mountpoint as /home

Also a swap partition wouldn't hurt unless you have like 2GB of RAM
 
Old 01-10-2005, 05:36 PM   #4
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 15
I don't know if it's wrong or not, but on my second hard disk during installation, I mount it at /krg (my initials) so I can remember where my disk is. I suppose you could say /dsk2 or /dsk3? Just a way for me to remember where my disk is and what is mounted to it.



AceMan
 
Old 01-10-2005, 06:12 PM   #5
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
You can mount a partition wherever you like, you just need to mkdir a directory and then mount it there
 
Old 01-10-2005, 06:36 PM   #6
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 15
During installation though, I don't think you have to as the OS install does it automatically, but I do understand. So if I am reading this clear, if I have 2 hd's in my computer and wanted to add a third with a mount point of /ace, I would have to mkdir ace, and then go in and edit fstab so it will mount it at startup? Just want to make sure i am understanding.




AceMan
 
Old 01-10-2005, 07:43 PM   #7
Dahak
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Okay, I understand that part. Thank you. (Hypothetical) However, let us assume a new hard drive (hdb) is plugged into the machine. It is now mounted at /home/whatever.

/home/whatever is a folder that existed on the old hard drive (hda) under the /home (hda3) partition. Would all files in /home/whatever be transferred (duplicated?) to the hdb1 partition, or just new ones?

Before:
/dev/hda1 /
/dev/hda2 /boot
/dev/hda3 /home

After:
/dev/hda1 /
/dev/hda2 /boot
/dev/hda3 /home
/dev/hdb1 /home/whatever
 
Old 01-11-2005, 12:06 AM   #8
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
So on hda1 you have /home/whatever and there are files and directories under that, then you mount hdb1 on /home/whatever any files that were there before disappear. Nothing is copied, it's like they didn't exist and you only have access to the files on hdb1. Once you u[n]mount the filesystem you have access to your old files and not your new ones.

If you want to use a seperate drive/partition for a user I suggest you mount the new partition in a temporary directory somewhere, copy the files over and then change your fstab
 
  


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
NFS sharing mountpoint? Shade Linux - Networking 2 04-28-2005 02:55 AM
Can't remove Samba mountpoint NelsonN Mandriva 3 02-19-2005 02:16 PM
Can't change permissions on mountpoint sharpie Linux - Newbie 7 03-28-2004 11:25 PM
selecting wrong mountpoint lesthanjakejohn Linux - General 1 10-18-2003 10:25 PM
permissions problems on mountpoint Little devil Linux - General 2 06-24-2003 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:34 PM.

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
Open Source Consulting | Domain Registration