Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
different forms of mount commands for proc and dev
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
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Tue Jun 07, 2011 4:29 pm    Post subject: different forms of mount commands for proc and dev Reply with quote

At the point in the standard installation process (i.e., from a minimal installation CD) where proc and /dev are mounted in preparation for chrooting, the Handbook says (in Pt. 1, Ch. 6, "Code Listing 1.4"):
Quote:
# mount -t proc none /mnt/gentoo/proc
# mount --rbind /dev /mnt/gentoo/dev

OTOH, The Gentoo Linux alternative installation method HOWTO, under "Installation from non-Gentoo LiveCDs", says:
Quote:
when you are asked to mount the proc system, issue the following command instead:
[...]
# mount -o bind /proc /mnt/gentoo/proc

But the same HOWTO, under "Installing Gentoo from an existing Linux distribution", doesn't say anything special about mounting proc and /dev (i.e., just follow the Handbook).

And the Gentoo Linux x86 Quick Install Guide (which assumes booting from a minimal installation CD) says:
Quote:
livecd / # mount -t proc proc /mnt/gentoo/proc
livecd / # mount --rbind /dev /mnt/gentoo/dev

Finally, in some "tips" I wrote up for myself a couple of years ago about how to install Gentoo from an existing (running) Gentoo system, which I presumably based on what the Handbook and the Alternative HOWTO said at the time:
Quote:
# mount -o bind /proc /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

But then later in the same document, when describing how to stop the installation process and resume it later, I have written:
Quote:
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

Hmm. So, I guess one of those is a mistake, since I see no good reason for the mounting of proc to be different the second (third, etc.) time versus the first time.

So here's my question: What's the difference between all these mount commands?

I (think I) understand that -o bind is used for already mounted filesystems (note the "/" in front of proc in the -o bind versions), and that --rbind is essentially just a more robust version of -o bind that includes any "submounts" within the specified "subtree".

But why is -t proc used when you've booted from a CD? And is there any difference between -t proc none and -t proc proc?


Last edited by dcljr on Thu Dec 22, 2011 3:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Tue Jun 07, 2011 6:42 pm    Post subject: Reply with quote

dcljr,

Allow me to refer you to
Code:
man mount

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Jun 07, 2011 8:37 pm    Post subject: Re: different forms of mount commands for proc and dev Reply with quote

dcljr wrote:
is there any difference between -t proc none and -t proc proc?

procfs isn't a real filesystem, so the second word is just used as a label instead of giving a device name to mount from.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Wed Jun 08, 2011 10:03 pm    Post subject: Reply with quote

dcljr,

-t proc none
Gives you an error message "none busy" in certain umount conditions

-t proc proc?
Gives "proc busy" in the same conditions.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Dec 22, 2011 3:00 am    Post subject: Reply with quote

I'm "resurrecting" this thread because I need more information. The answers above only seem to address the most minor of my questions, the difference between "none" and "proc" in the proc-mounting command (and, BTW, let's pretend like I've actually read the man page for mount but still need someone to explain this to me).

The important question is this: why is it that when you've booted from the installation CD or when you're installing from an existing Linux distribution, you can use the "regular" (i.e., from the Handbook) version:
Quote:
# mount -t proc none /mnt/gentoo/proc

but when you're installing from a "non-Gentoo LiveCD", you're supposed to use:
Quote:
# mount -o bind /proc /mnt/gentoo/proc

What is the fundamental difference between the scenarios that necessitate the different forms of the command?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22686

PostPosted: Thu Dec 22, 2011 3:05 am    Post subject: Reply with quote

If /proc is already a procfs, then you can bind mount it into other places where you need a procfs. If it is not, or if you are not sure, then you need to mount a procfs at the desired location.
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Dec 22, 2011 9:24 am    Post subject: Reply with quote

Hu wrote:
If /proc is already a procfs, then you can bind mount it into other places where you need a procfs. If it is not, or if you are not sure, then you need to mount a procfs at the desired location.

Hmm. So am I to understand that when someone boots from a "non-Gentoo LiveCD", they are guaranteed to have a procfs mounted at /proc, but if they boot from the installation CD or anything else ("an existing Linux distribution") they aren't? That doesn't make sense to me. How can you have a running Linux system without a procfs mounted at /proc?

Also, the fact that you say "or if you are not sure" makes it sound like it's optional, or something — as if you could just always use the second ("-t proc") form. But that can't be true, otherwise they wouldn't have to tell people specifically to use the "-o bind" version in the "alternative installation" HOWTO. So why do they tell people that?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Dec 22, 2011 12:33 pm    Post subject: Reply with quote

You're overthinking this. In all cases (I believe), the Handbook form is acceptable. You're also talking about a nuance that can have no effect whatsoever on your eventual installed Gentoo system.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Dec 22, 2011 3:14 pm    Post subject: Reply with quote

John R. Graham wrote:
In all cases (I believe), the Handbook form is acceptable. You're also talking about a nuance that can have no effect whatsoever on your eventual installed Gentoo system.

That answered my question! Thank you! :)

Bu-u-u-t...

The HOWTO sez (slightly edited to remove code snippet "titles"):
Quote:
[...] Next, you'll need to create the /mnt/gentoo mountpoint.
Code:
# mkdir /mnt/gentoo

At this point, you can pick up with the standard install documentation at part 4. However, when you are asked to mount the proc system, issue the following command instead:
Code:
# mount -o bind /proc /mnt/gentoo/proc

When you're ready to unpack the stage tarball in part 5 [...]

That certainly makes it look like it's important to use a different form of the command! Are you telling me one of the authors went to the trouble of including this instruction for absolutely no reason?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Dec 22, 2011 3:16 pm    Post subject: Reply with quote

Well, I'm sure the author had a reason, if only for personal preference. However, this is like having an intricate and abstruse discussion about the color of paint on the scaffolding that the brickmasons use to lay the brick for your house. The question is, "How does this affect your house?"

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
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