You are not logged in.

#1 2015-12-05 00:56:48

maggie
Member
Registered: 2011-02-12
Posts: 255

Using a tmpfile to set a variable doesn't work

I would like to use /etc/tmpfiles.d/raid.conf to set a parameter but it isn't working upon a reboot.

/etc/tmpfiles.d/raid.conf 
w /sys/block/md0/md/stripe_cache_size - - - - 32768

If there a better way to do this and why doesn't this work?

Offline

#2 2015-12-05 02:31:47

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: Using a tmpfile to set a variable doesn't work

Use a udev rule.

The following will print all possible attribute values which will help with writing the rule:

udevadm info -a -p /sys/block/md0/md 

Offline

#3 2015-12-24 01:47:40

t.ask
Member
Registered: 2013-01-14
Posts: 11

Re: Using a tmpfile to set a variable doesn't work

It would be nice to giving an example for "stripe_cache_size" setting via udev. The provided command doesn't work, while the folder exists.

udevadm info -a -p /sys/block/md0/md 

This just prints:

syspath not found

Using the command:

udevadm info -a -p /sys/block/md0/md 

prints:

  looking at device '/devices/virtual/block/md0':
    KERNEL=="md0"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{alignment_offset}=="0"
    ATTR{capability}=="50"
    ATTR{discard_alignment}=="0"
    ATTR{ext_range}=="256"
    ATTR{inflight}=="       0        0"
    ATTR{range}=="1"
    ATTR{removable}=="0"
    ATTR{ro}=="0"
    ATTR{size}=="1404665856"
    ATTR{stat}=="  231382        0 24826098        0   112453        0 21962488        0        0        0        0"

But where is "stripe_cache_size" then. My RAID-0 is slower than using the SSD drives without RAID, I hope someone can help with setting "stripe_cache_size" here.

Last edited by t.ask (2015-12-24 01:51:02)

Offline

#4 2015-12-26 03:06:46

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Using a tmpfile to set a variable doesn't work

Try:

SUBSYSTEM=="block", KERNEL=="md0", ATTR{md/stripe_cache_size}="32768"

You might need a new line with tmpfile, i.e. 32768\n

Last edited by tom.ty89 (2015-12-26 03:07:01)

Offline

Board footer

Powered by FluxBB