mdconfig via rc.conf
dteske at FreeBSD.org
dteske at FreeBSD.org
Wed Mar 5 20:28:09 UTC 2014
> -----Original Message-----
> From: aurfalien [mailto:aurfalien at gmail.com]
> Sent: Wednesday, March 5, 2014 11:43 AM
> To: dteske at FreeBSD.org
> Cc: FreeBSD Mailing List
> Subject: Re: mdconfig via rc.conf
>
> On Mar 5, 2014, at 10:56 AM, dteske at FreeBSD.org wrote:
>
> >
> >
> >> -----Original Message-----
> >> From: aurfalien [mailto:aurfalien at gmail.com]
> >> Sent: Tuesday, March 4, 2014 2:14 PM
> >> To: FreeBSD Mailing List
> >> Subject: mdconfig via rc.conf
> >>
> >> Hi,
> >>
> >> Are there any other parameters I would need to setup a ram disk at
> >> boot
> > time?
> >>
> >> I have this in my rc.conf;
> >>
> >> mdconfig_md100="-t malloc -s 12G"
> >>
> >> I've opted not to mount or format it for now.
> >>
> >> But upon boot, I do not see the md100 device.
> >>
> >> Is there anything I need in rc.conf to enable this?
> >>
> >> Thanks in advance,
> >>
> >> - aurf
> >>
> > [Devin Teske]
> >
> > Sorry for late reply. But here's what you want...
> >
> > # In /etc/rc.conf
> > mdconfig_md0="-t malloc -s 12G"
> >
> > # In /etc/fstab
> > /dev/md0 /mymountpoint ufs rw,noatime 0 0
> >
> > You see... /etc/rc.d/mdconfig will perform "mount -d /dev/md0" to see
> > if there is a mountpoint configured for md0 in /etc/fstab.
> >
> > If "mount -d /dev/md0" reports that there is no entry for md0, then
> > the /etc/rc.d/mdconfig script will not mount your device.
> >
> > Also, as others have mentioned, you can not (currently) arbitrarily
> > have gaps in the numbering system. You have to start with md0 and then
> > use md1, md2, ad nauseum. The script /etc/rc.d/mdconfig currently
> > stops at the first undefined value. So in the case of not setting md0
> > but only a single md100, nothing will be done (0 being undefined
> > terminates the loop).
> > --
> > Devin
>
> So if I do;
>
> mdconfig -a -t swap -s 12G
>
> I get /dev/md0 no issues. I chose swap rather then malloc due to RWs
> suggestion previously.
>
> Keep in mind I don't wish to mount it just yet.
>
> However if I put the value in rc.conf;
>
> mdconfig_md0="-a -t swap -s 12G"
>
[Devin Teske]
FYI: Do not put "-a" in the line.
mdconfig_md0="-t swap -s 12G"
By having the "-a" in there, you essentially executed:
mdconfig -a -a -t swap -s 12G
Which should still work, btw -- just mentioning the redundancy.
> I do not see an /dev/md device
>
[Devin Teske]
It works for me ... (note: "sr" is just a symlink to "sudo")
dteske at scribe9.vicor.com ~ $ sr mdconfig -lv
dteske at scribe9.vicor.com ~ $ sysrc mdconfig_md0
mdconfig_md0: -t swap -s 16M
dteske at scribe9.vicor.com ~ $ grep md0 /etc/fstab
dteske at scribe9.vicor.com ~ $ sr service mdconfig start
Creating md0 device (swap).
mount: /dev/md0: unknown special file or file system
dteske at scribe9.vicor.com ~ $ sr mdconfig -lv
md0 swap 16M
dteske at scribe9.vicor.com ~ $ sr service mdconfig stop
Device /dev/md0 isn't mounted.
Destroying md0.
dteske at scribe9.vicor.com ~ $ sr mdconfig -lv
dteske at scribe9.vicor.com ~ $
--
Devin
_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
More information about the freebsd-questions
mailing list