Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chrooting mounting qustion
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
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 12:22 pm    Post subject: Chrooting mounting qustion Reply with quote

Hey guys.

I'm following the handbook and I have a question and don't want to proceed any further without some information.
I am at the stage where I'm getting ready to enter the new environment and I just mounted the necessary system files,
but I don't have the /mnt/gentoo/ directories and so I used the following commands instead:

Code:
root #mount --types proc /proc /proc
root #mount --rbind /sys /sys
root #mount --make-rslave /sys
root #mount --rbind /dev /dev
root #mount --make-rslave /dev

But I think this is wrong. If it is, do I need to unmount these filesystems and make the /mnt/gentoo/ directories?
And what about the files therein? What do I do with those? How do I get, for instance, /etc/ to be in /mnt/gentoo/etc?

Help pls,
Chilos

[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6316
Location: /usr/lib64/lv2

PostPosted: Sat Mar 03, 2018 1:31 pm    Post subject: Reply with quote

You need to specify a mount point. Whatever you used to boot, you should be able to mkdir -p /mnt/gentoo. It doesn't have to be /mnt/gentoo, though - it's merely a mount point. It could be /blah/ugh/whatever, as long as it's an empty dir.

It looks like you also skipped mounting your filesystems - or at least you didn't mention it here.

Reboot your system with your boot medium. Once at a prompt, if you don't have /mnt/gentoo, then
Code:

mkdir -p /mnt/gentoo


Now you need to mount your filesystems - root and boot:
Code:

mount /dev/sda4 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda2 /mnt/gentoo/boot


Don't forget to swapon /dev/sda3.

If you've followed the handbook exactly, then you'll have exactly what's shown above. Otherwise, replace "sda4" and "sda2" with your root and boot partitions.

Now you need the system mounts, and these have to be attached to your now-mounted filesystem:
Code:

mount -t proc /proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
mount --rbind /sys /mnt/gentoo/sys


You only need make-rslave if you plan to use systemd.

I hope this helps.
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 9:14 pm    Post subject: Reply with quote

So I used mkdir -p /mnt/gentoo to make the directory and rebooted but when I type: mount /dev/sda4 /mnt/gentoo

it gives me an error:

"NTFS signature is missing.
Failed to mount '/dev/sda4' : Invalid argument
The device '/dev/sda4' doesn't seem to have a valid NTFS.
Maybe the wrong devices is used? Or the whole disk instead of a partition."

And you said that I hadn't mounted my filesystems, but I thought that's what the code in the op does?

Thanks for the help,
chilos
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6316
Location: /usr/lib64/lv2

PostPosted: Sat Mar 03, 2018 9:17 pm    Post subject: Reply with quote

Just so I understand, you're trying to install Gentoo, right? NTFS is not a filesystem you should be using. Are you following the handbook?
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 9:23 pm    Post subject: Reply with quote

yes, I didn't use NTFS. I don't know why it's saying that.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 03, 2018 9:42 pm    Post subject: Reply with quote

chilos,

The mount command grafts things onto the filesystem tree, which has its root at / (also called root),
The root of the filesystem tree is established when the system boots.

As you are not booting into your Gentoo install, you need to graft the bits of your gentoo install onto the filesystem provided by the boot media.

Handbook (and gentoo minimalCD) use /mnt/gentoo for this.
/mnt/gentoo is where your growing install will be. Everything inside /mnt/gentoo belongs to your install. Everything outside does not.

The mount command needs at least two parameters. The name of the device holding the filesystem you want to attach to the tree and the location at which it must be attached.

Its possible to tell mount the type of filesystem to attach too. If you don't, it tries all the filesystems the kernel knows.
When it fails, it prints the name of the last filesystem it tried. For you, NTFS.

We can tell that you are not using a Gentoo LiveCD for your install. It already has /mnt/gentoo for you.
It sounds like you did not make a filesystem on your /dev/sda4 before you tried to mount it.
_________________
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
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 10:03 pm    Post subject: Reply with quote

So I figured out something I did wrong. I was trying to use the command mkfs in parted instead of in root so I thought I had made the filesystems when I hadn't. Going to try to mount now.
Back to top
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 10:51 pm    Post subject: Reply with quote

So now I have my filesystems in place and they are mounted (I think...how can I check?). And now I am trying to enter the new environment and chroot.

Entering: # chroot /mnt/gentoo /bin/bash

Gives error: failed to run command '/bin/bash' : No such file or directory.

What'sup?
Back to top
View user's profile Send private message
superjaded
l33t
l33t


Joined: 05 Jul 2002
Posts: 761

PostPosted: Sat Mar 03, 2018 11:01 pm    Post subject: Reply with quote

Did you download and extract a stage3 tarball as described in sections 1.3 and 1.4 on this page in the guide?

When you do a mkfs command, it formats the drive so there's no longer anything on it. The command reports says what it does due to /mnt/gentoo/bin/bash not existing. That should come from your stage3 tarball. If you did it before you ran the mkfs command, you'd have to do it again.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 03, 2018 11:15 pm    Post subject: Reply with quote

chilos,

Code:
df -h
will show what is mounted where.

Your filesystems are empty until you write files to them.
You can't chroot into an empty filesytem.

Where are the instructions you are following to install Gentoo?
_________________
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
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 03, 2018 11:30 pm    Post subject: Reply with quote

NeddySeagoon wrote:
chilos,

Code:
df -h
will show what is mounted where.

Your filesystems are empty until you write files to them.
You can't chroot into an empty filesytem.

Where are the instructions you are following to install Gentoo?


When I use df -h I don't see anything mounted in /mnt/gentoo/proc or /mnt/gentoo/sys or /mnt/gentoo/dev

I manually made these directories before mounting them (it wouldn't let me otherwise). After typing in the mount commands, is there supposed to be some dialogue that tells you if it works or not?

And here is the ink to the handbook I'm using:
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base

And thanks superj, I guess I have to extract a stage3 tarball again.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 03, 2018 11:52 pm    Post subject: Reply with quote

chilos,

You are doing things in the wrong order.
Mount your root at /mnt/gentoo. Leave /boot for now.
Untar the stage3 onto /mnt/gentoo. This will make /proc, /sys, /dev and /boot for you

Now mount /proc, /sys, /dev and /boot.

Thats the right guide but did you miss Installing the Gentoo installation files?
_________________
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
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 04, 2018 1:12 am    Post subject: Reply with quote

I was in the right order. Then I had to go back because I made an error. OK thanks. I just mounted my root at /mnt/gentoo (and it took). Had to configure the network again before downloading the stage 3 tar ball. Extracted the ball in /mnt/gentoo and mounted /proc, /sys, /dev, and, /boot, but when I check the mounts with df -h, only my root shows up (as well as some others but none of the one's just listed).

Something I'm doing wrong?
Back to top
View user's profile Send private message
superjaded
l33t
l33t


Joined: 05 Jul 2002
Posts: 761

PostPosted: Sun Mar 04, 2018 2:37 am    Post subject: Reply with quote

If you did a df -h AFTER you chrooted, you would only see the mounts that are in your chroot. Under Mounted on, you should see something mounted to / -- does the filesystem column the same device you did the mkfs command on earlier?

Additionally, you wouldn't see the system mounts (proc, sys, dev) via df -h unless you also did df -ha (for all mounts).

Also, I noticed you said you mounted /{dev,sys,proc,boot} rather than /mnt/gentoo/{dev,sys,proc,boot}. Did you mean that as shorthand, or perhaps did you mount those filesystems outside of /mnt/gentoo? When you chroot, you are basically making /mnt/gentoo the root of your system /mnt/gentoo in that shell, so if you don't mount those devices to /mnt/gentoo, they won't be accessible.
Back to top
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 04, 2018 3:00 am    Post subject: Reply with quote

Yea just shorthand.

When I look at df -ha (after chrooting), the file system tmpfs is mounted on /

I don't know what tmpfs is? It's showing something different than before I believe.
A few days ago I had some trouble and instead of mounting /mnt/gentoo/{proc,dev,sys} I mounted just /proc instead or just /dev etc.
My df -ha shows these mounts? Could they be interfering? Should I unmount them?

I'm seeing file systems mounted on /mnt/cdrom, /mnt/livecd, but nothing on /mnt/gentoo.

I just checked /mnt/gentoo and there are no files/directories in there now.
But how can that be? since I just extracted the tar ball there and changed my /mnt/gentoo/etc/portage/make.conf file there?

It's like everything I did (from my last post) reverted.
Back to top
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 04, 2018 8:28 am    Post subject: Reply with quote

Well, I screwed this install up. So, I want to try again. But, I don't know how to start from scratch.
The first splash screen I see when I boot up says, "press any key to boot from disk in the next 15 seconds" ... but I don't see how to start fresh.

Any help?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 04, 2018 12:26 pm    Post subject: Reply with quote

chilos,

That message must be from your BIOS.
Its not produced by Gentoo.

I suspect it means you are using BIOS mode and did not set the bootable flag on one of the partitions on your HDD.
It needs to be set on the protective MSDOS partition if you are using GPT on a non EFI system.

To start over, boot from your live media and start from making filesystems.
Your partitions are already made.

It can be a bad thing to mix BIOS and GPT. It adds extra complexity and it does not always work.
If your system is in BIOS mode, use a MSDOS partition table and avoid the complexity of the mix.
_________________
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
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 04, 2018 5:38 pm    Post subject: Reply with quote

Hmm. So with the minimal boot cd, I can't boot into UEFI mode. So I had to choose BIOS mode.
I had set the boot flag and the esp flag for my boot partition. And used the GPT label.

If I wasn't clear, the message I was getting was after I had booted into my USB. Ie the first screen you see after you boot into gentoo.

I'll try changing the filesystems. That'll reformat everything. Thanks for the help!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 04, 2018 5:49 pm    Post subject: Reply with quote

chilos,

The Gentoo minimal CD does not support EFI mode.
Start with System Rescue CD instead.
Its Gentoo based and you can follow the handbook with no extra steps.
_________________
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
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