fstab gaffe!

I made a mistake while following this guide: http://forums.freebsd.org/showthread.php?t=38154
I pointed to a wrong drive for /boot and now got knocked down to single user mode. I can't find the fstab file to edit it.

Code:
vi /mnt/etc/fstab

Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0s1a    /mnt/boot               ufs     rw      1       1

Instead of ada0s1a I should have specified a USB drive.


Where do I find & how do I edit my fstab?

:q
 
Well if you're in single user mode, it mounts root but nothing else and assuming you have the default partitioning scheme, /etc will be on the root partition, the only thing you should have to do is remount the root partition as read write. Then find a way to fix your fstab file, if you can, mount /usr so you can use ee or vi to edit /etc/fstab.
 
This is root on ZFS. Or rather, root on GELI-encrypted ZFS. So presumably there is a separate /boot to get the encrypted device created.
 
wblock@ said:
This is root on ZFS. Or rather, root on GELI-encrypted ZFS. So presumably there is a separate /boot to get the encrypted device created.

There is a /boot om the USB drive that I'm booting from. I'm having trouble using [CMD=]ee[/CMD] to edit the fstab in /etc/root because it doesn't fully show up on the screen. It tells me that there are 4 lines in it, but I can't see them.
 
Screenshot.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    97.6 KB · Views: 594
@wblock@, I booted up with mfsBSD (via USB drive). I believe fstab that I need to edit is on the other USB drive that I usually boot from. Is this right? Do I need to mount the root filesystem from the other USB drive? The other USB drive is da0 in /dev

I tried to mount it with mount to no avail.

What am I not doing right?
 

Attachments

  • jkghuih.jpg
    jkghuih.jpg
    73.3 KB · Views: 730
Last edited by a moderator:
mfsBSD is memory-based. Once it has loaded, remove that USB stick and connect the other. Or leave them both connected, but realize that it may change the device numbers.
 
Thanks, both USB drives are plugged in. (I should have mentioned that from the start.)

:)

I tried mounting da0 in different ways, but I cant get it to work
Code:
#cd /mnt && mkdir usb
#mount dev/da0 /mnt/usb
mount: no such file or directory

#camcontrol devlist
lists it as
Code:
< 1.20>             at scbus3 target 0 lun 0 (da0,pass2)

# cd /dev && ls -a gives me da0-related entries of da0, da0p1, da0p2, and da0p3


attachment.php



I know I'm doing something wrong, but what?
 
I figured out what I was doing wrong, but when I opened the fstab on da0p2 it was empty. I'm just going to start all over.
 
After the last post I made a fresh FreeBSD 9.1 install, but unfortunately after yet another try I screwed something up once again:

attachment.php


Code:
root@z0nder:/ # mkdir -p /mnt/mnt/boot
root@z0nder:/ # ee /mnt/etc/fstab
^[ (escape) menu  ^y search prompt  ^k delete line   ^p prev li   ^g prev page
^o ascii code     ^x search         ^l undelete line ^n next li   ^v next page
^u end of file    ^a begin of line  ^w delete word   ^b back 1 char
^t top of text    ^e end of line    ^r restore word  ^f forward 1 char
^c command        ^d delete                          ^z next word
=====line 3 col 12 lines fr                         ===========================
# Device        Mountpoint      FStype  Options Dump    Pass#

[color="Red"]/dev/da0p1      /mnt/boot       boot    rw      1       1[/color]
/dev/da0p2      /               ufs     rw      1       1
/dev/da0p3      none            swap    sw      0       0












"/mnt/etc/fstab" 5 lines, 159 characters
root@z0nder:/ # ln -s /mnt/boot/boot /mnt/boot
root@z0nder:/ # ee /boot/loader.conf
^[ (escape) menu  ^y search prompt  ^k delete line   ^p prev li   ^g prev page
^o ascii code     ^x search         ^l undelete line ^n next li   ^v next page
^u end of file    ^a begin of line  ^w delete word   ^b back 1 char
^t top of text    ^e end of line    ^r restore word  ^f forward 1 char
^c command        ^d delete                          ^z next word
=====line 3 col 29 lines fr                         ===========================
[color="Green"]geom_eli_load="YES"
zfs_load="YES"
vfs.root.mountfrom="zfs:tank"
[/color]













"/boot/loader.conf" 3 lines, 65 characters
root@z0nder:/ # ee /mnt/etc/rc.conf
^[ (escape) menu  ^y search prompt  ^k delete line   ^p prev li   ^g prev page
^o ascii code     ^x search         ^l undelete line ^n next li   ^v next page
^u end of file    ^a begin of line  ^w delete word   ^b back 1 char
^t top of text    ^e end of line    ^r restore word  ^f forward 1 char
^c command        ^d delete                          ^z next word
=====line 7 col 16 lines fr                         ===========================
hostname="z0nder.mesh"
ifconfig_re0="DHCP"
sshd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
[color="Green"]zfs_enable="YES"[/color]










"/mnt/etc/rc.conf" 7 lines, 174 characters
root@z0nder:/ # cp /mnt/zpool.cache /boot/zfs/zpool.cache

I thought I did everything correctly this time in the fstab, but I guess I was wrong.

Code:
gparted: Command not found.

=>      34  15633341  da0  GPT  (7.5G)
[color="Red"]        34       128    1  freebsd-boot  (64k)[/color]
       162  14847872    2  freebsd-ufs  (7.1G)
  14848034    780288    3  freebsd-swap  (381M)
  15628322      5053       - free -  (2.5M)

root@z0nder:/usr/home/a0943037 # fdisk /dev/da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=973 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=973 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 238 (0xee),(EFI GPT)
    start 1, size 15633407 (7633 Meg), flag 80 (active)
        beg: cyl 0/ head 0/ sector 2;
        end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
I'm following this guide: http://forums.freebsd.org/showthread.php?t=38154

I'm pretty stuck now. Could someone please give me a hint at what is the matter with my setup?
 

Attachments

  • IMG_2768.jpg
    IMG_2768.jpg
    82 KB · Views: 586
One thing that jumps right at me is that you're trying to mount the freebsd-boot partition at /mnt/boot. That's a mistake, the partition that contains the /boot/gptboot bootcode is not meant to be mounted because it does not have a filesystem. Do you mean to mount some other partition at /mnt/boot?
 
Thank you for reply. I know there is a mistake somewhere with partitions. I do not fully understand what I am doing (big part of the problem/problemsolving equation). Here is the relevant section in the guide that I'm following:


blakkheim said:
Code:
zpool create -o altroot=/mnt -o cachefile=/var/tmp/zpool.cache tank mirror /dev/ada1.eli /dev/ada2.eli
zpool export tank
zpool import -o altroot=/mnt -o cachefile=/var/tmp/zpool.cache tank
zpool set bootfs=tank tank
cp /var/tmp/zpool.cache /mnt/zpool.cache

Copy the files from the minimal installation over to the new encrypted pool. You'll want to copy every directory except /boot and /mnt. In my case, that's:

Code:
cd /
cp -Rvp bin dev etc home lib libexec media proc rescue root sbin sys tmp usr var /mnt/
mkdir -p /mnt/mnt/boot

Edit the fstab on the zpool to reflect our /boot being the unencrypted drive, then create a symlink for it.

Code:
vi /mnt/etc/fstab
ln -s /mnt/boot/boot /mnt/boot

In my case, fstab was:

Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0s1a    /mnt/boot               ufs     rw      1       1

Add these to /boot/loader.conf:

Code:
geom_eli_load="YES"
zfs_load="YES"
vfs.root.mountfrom="zfs:tank"

Add this to /mnt/etc/rc.conf:

Code:
zfs_enable="YES"

Copy over the zpool.cache and reboot:

Code:
cp /mnt/zpool.cache /boot/zfs/zpool.cache
reboot

It should now ask you for a passphrase on startup:

RfHNa4q.png


And once we login...

zhoOl4M.png


That's it! You can remove everything in /mnt/boot except boot.

Sources:
1, 2, 3
 
Looking at the parts of the guide you quoted it seems that you're not even following it to the letter but trying to adapt it without understanding what you're doing. The guide clearly shows MBR partititioning on the disk but you're using GPT.
 
@FreeDomBSD, do not mass-delete your posts, it makes topics entirely incomprehensible.
 
Last edited by a moderator:
Back
Top