2

I have 1GB RAM installed and I want to enlarge both nodes md0 and md1

/dev/md0              38M    216K     35M     1%    /tmp
/dev/md1              58M     20M     33M    39%    /var

I tried this but it fails:

# mdconfig -r -s 128M -u 0
mdconfig: ioctl(/dev/mdctl): Operation not supported`

What command should I use?

1

In FreeBSD, "md" devices are "memory disks" aka, RAM disks. Their content will go away and be lost if you reboot or re-create them. The size is specified using the -s flag to mdconfig or in fstab (see the fstab man page, under the EXAMPLES section, there is a reference to an md10). You can resize them using the mdconfig -r command, but keep in mind that this only resizes the md block device and doesn't resize the filesystem on the md. It's probably easier to just recreate the md than to bother with resizing both the md then resizing the filesystem, but it should be doable using growfs.

I should point out to you that while having /tmp as md is fine, having /var as md is probably a bad idea. While the data under /var is "variable" by definition, it is not transient. If you make /var a md you will lose this data after you reboot. For example your pkg database is stored there, as well as many other important files. Making /var a md will mean that, for example, if you reboot you will lose all your pkg info and be unable to pkg upgrade as there will be no record of what's installed.

  • Thanks for your reply. I asked for resize because the manpage lists a -r option "Resize a memory disk." /var is on md because it is a pfsense firewall, that has all persistent content in /var linked to /cf wich is remounted rw each time the firewall configuration is changed to protect the cf flashdrive from exessive write. Now an IDS wants more /tmp for unpacking rule sets and I also would like more /var for logs that I want to collect daily and send via email- – fdafgfdgfagfdagfdagfdagfdagfda Mar 4 '15 at 17:01
  • Which man page are you looking at? Also, you should tag your post with the pfsense tag or otherwise let folks know you aren't running vanilla FreeBSD so our expectations are set correctly. Oh, I see you're looking at the mdconfig man page. I guess I was wrong about the resize, sorry. – Steve Wills Mar 6 '15 at 2:56
  • Yes I added the tag. I use pfsense2.2 based on releng/10.1 - I tried to search with google but all I found was the mdconfig manpage where I found the resize flag, therefore I ask how to use it – fdafgfdgfagfdagfdagfdagfdagfda Mar 6 '15 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.