Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] mount questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
HungGarTiger
Apprentice
Apprentice


Joined: 04 Feb 2014
Posts: 155
Location: /nz/auckland

PostPosted: Fri Aug 08, 2014 5:11 am    Post subject: [solved] mount questions Reply with quote

Hi Guys,

I just have a couple questions regarding the 1st mounting step in the handbook. So I've created my partitions - SWAP, / and /home, then I..

Code:
mount /dev/sda2 /mnt/gentoo

and
Code:
mount /dev/sda3 /mnt/gentoo/home


I just want to know, what do these commands mount? Where do they mount from?

Are they mounting (/gentoo and /gentoo/home) file systems from the USB live system? Maybe this is a technical or a stupid questions but, i've never actually understood this command..

Any insight is appreciated


Last edited by HungGarTiger on Fri Aug 08, 2014 9:33 am; edited 1 time in total
Back to top
View user's profile Send private message
wraeth
Developer
Developer


Joined: 08 May 2007
Posts: 71
Location: Australia

PostPosted: Fri Aug 08, 2014 6:19 am    Post subject: Reply with quote

`mount` is a linux command to attach the filesystem on a given hard disk partition to the specified mount point, allowing you to access that filesystem as though it was an extension of the location where it is mounted. When you mount a partition, you turn the target mount point (in the first case /mnt/gentoo) from an ordinary folder into the top of a whole new filesystem. Before mounting, specifying the file /mnt/gentoo/myfile would mean a file on the live environment's filesystem in the /mnt/gentoo directory, however after mounting a different filesystem there, it would point to the file 'myfile' in the root of the new filesystem.

In terms of where they mount from, /dev is a special directory that contains special files, called nodes, to represent your hardware. Typically, disk drives are addressed as /dev/sda, /dev/sdb, /dev/sdc and so on. The number at the end specifies which partition on that disk you're addressing.

So, the command `mount /dev/sda2 /mnt/gentoo` means attach the filesystem on the second partition of the first disk to the location /mnt/gentoo, so that everything from /mnt/gentoo actually refers to files on that filesystem.

This is the first time I've tried explaining it like this - have I explained things clearly enough?
Back to top
View user's profile Send private message
HungGarTiger
Apprentice
Apprentice


Joined: 04 Feb 2014
Posts: 155
Location: /nz/auckland

PostPosted: Fri Aug 08, 2014 9:08 am    Post subject: Reply with quote

Wraeth, yes you have. I understand the command in concept and function although, from the live disk point-of-view I wasn't sure where "/mnt/gentoo" is mounting from... maybe I'm thinking about it in too much detail though..

The way I understand it is, on /dev/sda2 you are creating the file structure '/mnt/gentoo'(/mnt/gentoo/home would be created on /dev/sda3, etc). Or have I got that backwards? As booting from a live USB you would already have the full linux file system structure on the USB Environment...
Back to top
View user's profile Send private message
wraeth
Developer
Developer


Joined: 08 May 2007
Posts: 71
Location: Australia

PostPosted: Fri Aug 08, 2014 9:20 am    Post subject: Reply with quote

The live environment has a filesystem of its own, and (at least for the Gentoo minimal installation CD's) it's filesystem contains the /mnt/gentoo directory. The only purpose of this directory is as a place for you to mount your root filesystem, so you can extract the stage3 archive and set up your system.

Once your root filesystem (/dev/sda2) is mounted at /mnt/gentoo, then anything in /mnt/gentoo (such as /mnt/gentoo/boot or /mnt/gentoo/etc/portage/make.conf) is really the /boot directory or /etc/portage/make.conf file on your root filesystem, but being accessed through the /mnt/gentoo mount point.

For extra points, when you perform the command `chroot /mnt/gentoo /bin/bash`, your telling the system that you want to change your root directory to be /mnt/gentoo (so that nothing can access anything coming from the live environment's filesystem) and to run the /bin/bash shell (so you can interact with the system and perform your installation). Once you are chroot'ed, this effectively means that "root" / really is the root of your real filesystem.
Back to top
View user's profile Send private message
HungGarTiger
Apprentice
Apprentice


Joined: 04 Feb 2014
Posts: 155
Location: /nz/auckland

PostPosted: Fri Aug 08, 2014 9:33 am    Post subject: Reply with quote

wraeth wrote:
The live environment has a filesystem of its own, and (at least for the Gentoo minimal installation CD's) it's filesystem contains the /mnt/gentoo directory. The only purpose of this directory is as a place for you to mount your root filesystem, so you can extract the stage3 archive and set up your system.

Once your root filesystem (/dev/sda2) is mounted at /mnt/gentoo, then anything in /mnt/gentoo (such as /mnt/gentoo/boot or /mnt/gentoo/etc/portage/make.conf) is really the /boot directory or /etc/portage/make.conf file on your root filesystem, but being accessed through the /mnt/gentoo mount point.

For extra points, when you perform the command `chroot /mnt/gentoo /bin/bash`, your telling the system that you want to change your root directory to be /mnt/gentoo (so that nothing can access anything coming from the live environment's filesystem) and to run the /bin/bash shell (so you can interact with the system and perform your installation). Once you are chroot'ed, this effectively means that "root" / really is the root of your real filesystem.


Thanks Wraeth, that is more or less how I understood it. Except not as clearly :)

I appreciate the time you spent spelling it out for me, I think I had it backwards in my mind. I'll mark the thread [solved] and thank you again sir for the explanation
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum