Temat: /tmp i extroot

Najpierw troche faktow:

# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.9M      3.9M         0 100% /rom
tmpfs                    14.4M      1.6M     12.8M  11% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                29.9G    207.5M     28.1G   1% /overlay
mini_fo:/overlay          3.9M      3.9M         0 100% /

No i moje pytanie (jako poczatkujacego linuksiarza): Czy w openwrt i extroot mozna bezproblemowo przeniesc tmpfs na /dev/sda1? Chce zmienic miejsce katalogu /tmp na zewnetrzny pendrive, bo jest na nim calkiem sporo miejsca, a ten folder jest bardzo waskim gardlem dla niektorych programow.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

2

Odp: /tmp i extroot

Możesz. Tylko musisz to zrobić w momencie kirsy system się uruchamia, więc albo /etc/init.d/boot albo montować przy okazji extroota. Możesz sprawdzić.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: /tmp i extroot

Czy jest to gdzies pokazane? Nie chcialbym czegos pobaranic i zrypac. Interesuje mnie wariant z boot, bo extroot juz mam.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

4

Odp: /tmp i extroot

Nie, chyba nikt nie wyczyniał czegoś takiego. Jak wrócę do domu to mogę sprawdzić.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez badziewiak 2010-12-29 18:47:51)

Odp: /tmp i extroot

Tak sobie mysle: Kupie hub usb za 25PLN, jakis pendrive 4GBza 29PLN i to wszystko wraz z tym 32GB wepne do routera. Pen 4GB by sluzyl za /tmp (bo najtanszy, to nie szkoda wykonczyc), drugi za extroot i udostepniane pliki. Brakuje mi tylko pomyslu jak to zrobic smile

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

6

Odp: /tmp i extroot

Normalnie, nic przecież nie stoi na przeszkodzie żebyś tak zrobił.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: /tmp i extroot

ja nie jestem ekspertem, ale wydaje mi sie, ze jakbym pisal oprogramowanie dla maszyny z ramdrivem "z urzędu", to pewnie wykozystywałbym to, ze mozna sobie po tym ramdrivie orać jak sie chce, bez przejmowania sie za bardzo wydajnością systemu.

jeżeli deweloperzy myślą podobnie (a pewnie tak jest, bo niby czemu mieliby nie wykozystywac okazji), to zamontowanie jakiegos wolnego nosnika zamiast ramu w /tmp znacznie obnizy wydajnosc urządzenia, które itak ma bardzo ograniczone zasoby sprzętowe...
oczywiscie to czysta spekulacja, bo nigdy tego nie sprawdzalem wink

8

Odp: /tmp i extroot

A używasz linuksa? To właśnie sprawdziłeś. Tam /tmp jest normalnie na dysku, dla przyśpieszenia można to w ramdysk wrzucić.

PS. Wracając do tematu - właśnie mam /tmp zamontowany jako ext2 z pendrive normalnie przez fstab. Działa jak na razie.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9 (edytowany przez badziewiak 2011-01-06 22:57:54)

Odp: /tmp i extroot

Zopatrzylem sie w hub usb i dodatkowego pendrive 4GB. Mozecie pomoc mi z montowaniem go na /tmp? Tak na marginesie: Pendrive ma bardzo slaba predkosc zapisu (ok. 1,5MB/s), a odczyt na odmiane przyzwoity - ~30MB/s (na PC).

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3968      3968         0 100% /rom
tmpfs                    14752       228     14524   2% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sdb1             31308928    211792  29506704   1% /overlay
mini_fo:/overlay          3968      3968         0 100% /
# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=14752k)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sdb1 on /overlay type ext3 (rw,noatime,errors=continue,data=writeback)
mini_fo:/overlay on / type mini_fo (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
# nano /etc/fstab
/dev/sdb1       /overlay        ext3    rw,noatime      0       0
/dev/sdb2       none    swap    sw      0       0
# dmesg
Linux version 2.6.32.25 (cezary@eko.one.pl) (gcc version 4.3.3 (GCC) ) #12 Sat Nov 27 16:35:43 CET 2010
prom: fw_arg0=00000007, fw_arg1=a1f77fb0, fw_arg2=a1f78440, fw_arg3=00000008
MyLoader: sysp=ff00fda3, boardp=dd28dd80, parts=7f00ff00
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR9132 rev 2, CPU:400.000 MHz, AHB:200.000 MHz, DDR:400.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat 802c7fd0, node_mem_map 81000000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8128 pages, LIFO batch:0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=TL-WR1043ND
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 29348k/32768k available (2075k kernel code, 3420k reserved, 390k data, 152k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:56
Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is TP-LINK TL-WR1043ND
bio: create slab <bio-0> at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  Š 2001-2006 Red Hat, Inc.
yaffs Nov 23 2010 22:32:00 Installing.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: s25sl064a (8192 Kbytes)
spi0.0: searching for MyLoader partition table at offset 0x10000
spi0.0: searching for MyLoader partition table at offset 0x20000
spi0.0: searching for MyLoader partition table at offset 0x30000
spi0.0: searching for MyLoader partition table at offset 0x40000
spi0.0: no MyLoader partition table found
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
Searching for RedBoot partition table in spi0.0 at offset 0x7f0000
No RedBoot partition table detected in spi0.0
spi0.0: no WRT160NL signature found
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000020000 : "u-boot"
0x000000020000-0x000000160000 : "kernel"
0x000000160000-0x0000007f0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=540000, len=2B0000
0x000000540000-0x0000007f0000 : "rootfs_data"
0x0000007f0000-0x000000800000 : "art"
0x000000020000-0x0000007f0000 : "firmware"
Realtek RTL8366RB ethernet switch driver version 0.2.2
rtl8366rb rtl8366rb: using GPIO pins 18 (SDA) and 19 (SCK)
rtl8366rb rtl8366rb: RTL5937 ver. 3 chip found
rtl8366rb: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth0: using fixed link parameters
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=21)
TCP westwood registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 152k freed
Please be patient, while OpenWrt loads ...
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
Button Hotplug driver version 0.3.1
ar71xx: pll_reg 0xb8050014: 0x1a000000
eth0: link up (1000Mbps/Full duplex)
Registered led device: tl-wr1043nd:green:usb
Registered led device: tl-wr1043nd:green:system
Registered led device: tl-wr1043nd:green:qss
Registered led device: tl-wr1043nd:green:wlan
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb 1-1: new high speed USB device using ar71xx-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: new high speed USB device using ar71xx-ehci and address 3
usb 1-1.1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usb 1-1.2: new high speed USB device using ar71xx-ehci and address 4
usb 1-1.2: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access     USB      DISK 2.0         1.00 PQ: 0 ANSI: 2
usb-storage: device scan complete
sd 0:0:0:0: [sda] 8017920 512-byte logical blocks: (4.10 GB/3.82 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
scsi 1:0:0:0: Direct-Access     SanDisk  Cruzer           8.02 PQ: 0 ANSI: 0 CCS
usb-storage: device scan complete
sd 1:0:0:0: [sdb] 64077823 512-byte logical blocks: (32.8 GB/30.5 GiB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 45 00 00 08
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1 sdb2
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] Attached SCSI removable disk
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb1, internal journal
ext3_orphan_cleanup: deleting unreferenced inode 507967
ext3_orphan_cleanup: deleting unreferenced inode 507963
ext3_orphan_cleanup: deleting unreferenced inode 507962
ext3_orphan_cleanup: deleting unreferenced inode 507961
ext3_orphan_cleanup: deleting unreferenced inode 507960
EXT3-fs: sdb1: 5 orphan inodes deleted
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with writeback data mode.
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
eth0: link down
ar71xx: pll_reg 0xb8050014: 0x1a000000
eth0: link up (1000Mbps/Full duplex)
device eth0.1 entered promiscuous mode
device eth0 entered promiscuous mode
br-lan: port 1(eth0.1) entering forwarding state
Compat-wireless backport release: compat-wireless-2010-10-14-7-gab01eca
Backport based on wireless-testing.git master-2010-10-19
cfg80211: Calling CRDA to update world regulatory domain
cfg80211: World regulatory domain updated:
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
ath: EEPROM regdomain: 0x0
ath: EEPROM indicates default country code should be used
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x3a
ath: Country alpha2 being used: US
ath: Regpair used: 0x3a
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy0: Atheros AR9100 MAC/BB Rev:0 AR2133 RF Rev:a2 mem=0xb80c0000, irq=2
cfg80211: Calling CRDA for country: US
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PPP generic driver version 2.4.2
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
ip_tables: (C) 2000-2006 Netfilter Core Team
cfg80211: Regulatory domain changed to country: US
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
    (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
    (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
NET: Registered protocol family 24
nf_conntrack version 0.5.0 (460 buckets, 1840 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
xt_time: kernel timezone is -0000
        Hooked IMQ after mangle on PREROUTING
        Hooked IMQ after nat on POSTROUTING
IMQ driver loaded successfully.
Ebtables v2.0 registered
usbcore: registered new interface driver ums-alauda
usbcore: registered new interface driver ums-cypress
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-isd200
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-karma
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
usbcore: registered new interface driver ums-usbat
fuse init (API version 7.13)
Adding 224900k swap on /dev/sdb2.  Priority:-1 extents:1 across:224900k
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
device wlan0 left promiscuous mode
br-lan: port 2(wlan0) entering disabled state
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
ar71xx-wdt: enabling watchdog timer
MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

10

Odp: /tmp i extroot

Probowalem odmontowac /tmp, ale

umount /tmp
umount: can't umount /tmp: Device or resource busy

Jak to ugryzc? Zakladam, ze najpierw musze uwolnic /tmp, potem moge np

# mount -w -t ext3 /dev/sda1 /tmp

Jakies pomysly?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

11

Odp: /tmp i extroot

/tmp musisz podmontować bardzo wcześnie, nie jak już system działa. Pogrzeb skryptach i tam gdzie mountuje się extroot zamontuj też /tmp. Przed uruchomieniem czegokolwiek co z /tmp korzysta.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: /tmp i extroot

Podepnę się pod wątek bo mam związane z /tmp pytanie. Na forum Openwrt wyczytałem, że ten podział 50/50 pomiędzy ramem a tmpfs jest zmienny. Jeśli będzie potrzeba więcej ramu a tmpfs będzie wolny to system dostanie więcej. Niby fajne rozwiązanie ale nie wiem czy to prawda, może coś źle zrozumiałem.
https://forum.openwrt.org/viewtopic.php?id=6995

13

Odp: /tmp i extroot

Prawda to, system tmpfs tak właśnie działa. Montując go podajesz ile maksymalnie może zająć pamięci, jak wykorzystujesz mniej to mniej zabiera po prostu.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

14

Odp: /tmp i extroot

Sorki za odkop ale bardzo interesuje mnie zamontowanie /tmp na zewnętrznym pendrive. Udało się to komuś?

OpenWRT na TP-LINK Archer C7 v2, Korbox Gigabitus (Zbtlink ZBT-WE1326), Xiaomi AIoT Router AC2350 | http://blog.sloniupl.eu/

15

Odp: /tmp i extroot

W preinit jest 10_essential_fs który montuje /tmp. Załaduj sobie wcześniej moduły od usb, systemy plików, i zamontuj nośnik jako /tmp

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

16

Odp: /tmp i extroot

A nie rzucił byś drobnym linkiem do jakiegoś how to albo jak się bawić z tym ładowaniem modułów ?

OpenWRT na TP-LINK Archer C7 v2, Korbox Gigabitus (Zbtlink ZBT-WE1326), Xiaomi AIoT Router AC2350 | http://blog.sloniupl.eu/

17

Odp: /tmp i extroot

Masz powtórzy dokładnie to co masz 50_* - tam jest ładowanie modułów do external roota.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

18 (edytowany przez grzenio 2012-05-15 15:00:01)

Odp: /tmp i extroot

rozumiem ze  z 10_essential_fs mozna usunac

do_mount_tmpfs() {
    calc_tmpfs_size
    mount tmpfs /tmp -t tmpfs -o size=$pi_size,nosuid,nodev,mode=1777
}

boot_hook_add preinit_essential do_mount_tmpfs

i dodac do 50_determine_usb_root ?

linux, wordpress , moj blog smile www.8px.pl

19

Odp: /tmp i extroot

Nie. To co jest w 50_* masz odpowiednio włożyć do do_mount_tmpfs().

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

20 (edytowany przez grzenio 2012-05-15 20:24:44)

Odp: /tmp i extroot

a mozna by poprosic o gotowy plik?
bo nie bardzo wiem co z tym zrobic dokladnie zeby niczego nie zwalic.

linux, wordpress , moj blog smile www.8px.pl

21

Odp: /tmp i extroot

Gdybym to już zrobił to pewnie zostało by udostępnione...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

22

Odp: /tmp i extroot

a nie planujesz moze tego zrobic ? w najblizszym czasie

linux, wordpress , moj blog smile www.8px.pl

23

Odp: /tmp i extroot

Na razie nie mam potrzeby smile

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

24 (edytowany przez grzenio 2012-05-15 21:23:05)

Odp: /tmp i extroot

a mozna prosic chociaz o jakies wieksze podpowidzi...

bo jak rozumiem tmpfs wchodzi do ramu wiec to zrzuci tmp na dysk zamiast ram tak?

ps. mam router na zbyciu smile

linux, wordpress , moj blog smile www.8px.pl

25

Odp: /tmp i extroot

Do tego dążysz. A że odbywa się to w bardzo wczesnym stadium uruchomienia routera, więc musisz sie zatroszczyć o załadowanie modułów od usb, usb-storage, systemów plików i zamontowanie partycji w /tmp zamiast w ramie.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.