After mount usb : The opkg update command failed with code 255

Dear all,
I am facing a new issue when trying to mount an usb to store packages.

This is what i did to :
opkg update opkg install kmod-usb-storage kmod-fs-ext4 kmod-fs-vfat block-mount

mkdir /mnt/usb mount /dev/sda1 /mnt/usb ls /mnt/usb

etc/config/fstab

config mount
    option target   /mnt/usb
    option device   /dev/sda1
    option fstype   ext4  # ou vfat selon votre format
    option options   rw,sync
    option enabled   1
/etc/init.d/fstab enable
/etc/init.d/fstab start

mount /dev/sda1 /mnt/usb

mkdir -p /mnt/usb/opkg-packages
mkdir -p /mnt/usb/opkg-lists
mkdir -p /mnt/usb/overlay

cp /tmp/opkg-lists/* /mnt/usb/opkg-packages/

/etc/opkg.conf

src/gz usb_packages http://downloads.openwrt.org/snapshots/packages/x86_64/base
dest root /
dest ram /tmp
lists_dir /var/opkg-lists
option overlay_root /overlay
option check_signature

/etc/config/fstab

config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'

config mount
    option target   /mnt/usb
    option device   /dev/sda1
    option fstype   vfat     # ext4  # ou vfat selon votre format
    option options   rw,sync
    option enabled   1

/etc/init.d/usb_mount

#!/bin/sh /etc/rc.common
START=99
STOP=10

start() {
    mount /dev/sda1 /mnt/usb
    opkg update
}

stop() {
    umount /mnt/usb
}
chmod +x /etc/init.d/usb_mount
/etc/init.d/usb_mount enable

Thank you in advance for your time !
Arnaud

Hope this wasn't an one liner.

Wouldn't it be simpler to soft link /tmp/opkg-lists to /mnt/usb/opkg-packages in rc.local, and skip all the reconfig ?

Hi @frollic , thank you again for your help !

No, 3 lines :slight_smile:
no idea of what is simpler.

And no idea of the actuel problem and how to solve it, except doing a reset.

Arnaud

You were just told how to solve it :slight_smile:

1 Like

ok, let s go ...
But what do you suggest to use usb to store packages (not enough space on my TP-Link ?

Is it this link ?

Thank you.
Arnaud

If you soft link the original folder, you can put the files anywhere you'd like.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.