1

I have followed the steps in the documentation, created a new EBS volume and attached it to the instance (I only have one). I rebooted and tried shutdown/start, but the device does not show up inside the FreeBSD instance. I only have /dev/ada0 and /dev/ada0a.

Are there maybe any other steps necessary to make this work for a FreeBSD instance? I don't know anything about the abstraction layers amazon is using. I guess a problem could be that FreeBSD device naming is different.

3
  • FreeBSD have disk devices named da - do you have any in the /dev?
    – Kondybas
    May 15, 2015 at 15:20
  • 2
    No, it turns out the device is named xbd5... this wasn't documented anywhere. And it didn't show up via gpart and friends either.
    – hasufell
    May 15, 2015 at 15:49
  • Oh, I've forgot you have a virtual machine. Under Xen freebsd see xbd devices, under Proxmox - vtbd and so on.
    – Kondybas
    May 15, 2015 at 18:12

2 Answers 2

3

@hasufell, your comment is correct - the device on BSD instances is not named using Linux/std AWS naming. I got the same device name you did - xbd5 - but you can confirm what the device name is by reviewing the system logs for <Virtual Block Device> entries (either grep dmesg/messages or through AWS Instance control panel - select instance, then Actions -> Instance Settings -> Get System Log). A 100GB device might show up like this in the log:

xbd5: 102400MB <Virtual Block Device> at device/vbd/51792 on xenbusb_front0

You can also run sysctl kern.disks and you should see something like:

kern.disks: xbd5 ada0

... where ada0 is your first EBS volume and xbd5 is your new attached volume.

Then just mount your new volume:

newfs /dev/xbd5
mkdir /yourvol
mount /dev/xbd5 /yourvol

Add to /etc/fstab to mount at boot:

/dev/xbd5 /yourvol ufs rw 0 2
1

You may need to add a partition number if the first partition is not of type "freebsd-ufs". For example, if you have a boot volume from machine A that you want to mount, for maintenance purposes, to machine B, then your first partition may be type freebsd-boot, and mount /dev/<device> /yourvol will fail with a "No such file or directory" error.

As a general solution, regardless of whether working with a blank or populated new volume and whether the first partition is or isn't "freebsd-ufs" type, you can add the partition to the mount operation as follows:

  1. Run gpart show to locate the first partition that is type "freebsd-ufs"

  2. Run mount /dev/<device>p<partition> /yourvol

For example, if gpart show displays the following:

=>       3  31457269  xbd5  GPT  (15G)
         3       111     1  freebsd-boot  (56K)
       114      1600     2  efi  (800K)
      1714  31455558     3  freebsd-ufs  (15G)

then you would mount with:

mount /dev/xbd5p3 /yourvol
1
  • Thank you very much, this was very useful!! Nov 9, 2021 at 8:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .