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?

0

2 Answers 2

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.

3
  • 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- Commented Mar 4, 2015 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. Commented Mar 6, 2015 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 Commented Mar 6, 2015 at 14:00
0

Assuming that Jherek is using pfSense, as he mentioned, the easiest way to change this setting is in the admin panel via your web browser. There you go to [System: Advanced: Miscellaneous] and look for the RAM Disk Settings. There you'll find what you need. I am using version 2.2.1, not sure if version 2.1.3 also has that option.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.