Mounting in OpenWrt

I have to create a new filesystem /dev/hda and mount it on /writable in openwrt, may i know where to change the code, am new to openwrt please help on this.

currently in my openwrt i have only

Filesystem Size Used Available Use% Mounted on
/dev/root 102.4M 32.7M 67.6M 33% /
tmpfs 4.0M 1.9M 2.1M 47% /tmp
/dev/sda1 15.7M 4.9M 10.5M 32% /boot
/dev/sda1 15.7M 4.9M 10.5M 32% /boot
tmpfs 512.0K 0 512.0K 0% /dev

What is the filesystem of the disk? Or you are asking how to format a disk?
For mounting suggest to read up on

Hi faser thanks for your reply.

i have downloaded the latest openwrt code and add few of my application and compiled,
am installing that image in virtual machine. for me filesystem /dev/hda4 as to mount on /writable

For eg:
/dev/hda4 400.0M 32.3M 367.7M 8% /writable

Actually am replacing buildroot with openwrt,

Hi faser,
i need to do a code change in such a way that after installing openwrt on my virtual machine the o/p of df -h command will be

df -h

Filesystem Size Used Available Use% Mounted on
/dev/hda2 141.6M 117.1M 17.5M 87% /
/dev/hda1 38.7M 749.0K 36.0M 2% /boot
/dev/hda4 400.0M 32.3M 367.7M 8% /writable
/dev/hda4 400.0M 32.3M 367.7M 8% /writable/data/webs-certs/cert.pem
/dev/hda4 400.0M 32.3M 367.7M 8% /writable/data/webs-certs/key.pem

if you're using x86, why not simply extend the main partition ?

and why would you mount the same disk three times, in the same spot ?

All information to do so are in the documentation I linked above.

Assume i need to create just .
/dev/hda4 400.0M 32.3M 367.7M 8% /writable

can you please explain briefly what code changes need to do in openwrt

what code changes ?

it's mounted, what do you need ?
and did you read the previously provided link ?

yes /etc/fstab configuration need to a change which consists of below.

filesystem mountpoint type options dump pass

not sure what and all arguments need to paa here

googled man fstab ?

if you're lazy, add the mount command to the local startup script,
then you don't need to figure out the fstab syntax.

there's probably a luci addon for doing it, too,

1 Like

Thanks frollic for help , adding mount command in rc.local file will do the job for me right ?

yes, it will.

1 Like

Thanks a lot

Install blockd. Execute block detect. Copy UCI section matching /dev/hda4. Add it to the /etc/config/fstab. Set enabled to 1.

there is also an installable LuCi GUI blade for managing fstab/mount points (I cant remember the package name)