Reseting the Tonidoplug2

Support for your TonidoPlug
CSaero
Rookie Tonidoid
Rookie Tonidoid
Posts: 4
Joined: Tue Aug 21, 2012 8:38 pm

Reseting the Tonidoplug2

Postby CSaero » Wed Aug 22, 2012 1:54 am

Hi, I would like to reset my plug since the internal flash is full and I can't access the web interface after unplugging the device a few times.

I'm not experienced with the command line, so I'm following the instructions on http://www.tonido.com/communitywiki/doku.php?id=advanceduses:resetrootfsplug2.

I tried the basic reset first. At step 6)

Code: Select all

rm -rf *
rm: cannot remove '...' : Read-only file system
...
...

for every file, so I tried fixing a Corrupt NAND Partition.

Everything works fine until I hit step 4):

Code: Select all

root@TonidoPlug2:/mnt# ubidetach /dev/ubi_ctrl -m 3
ubidetach: error!: cannot detach mtd3
           error 16 (Device or resource busy)


I stopped here because I don't want to risk bricking my device, but how should I proceed?

Thank you for your time.

Tuxedo
Tonido Team
Tonido Team
Posts: 1458
Joined: Wed Jan 28, 2009 11:30 pm

Re: Reseting the Tonidoplug2

Postby Tuxedo » Wed Aug 22, 2012 7:23 pm

It looks like the plug is not booting on the USB disk. It seems to be booting with the flash.
Re-run command on step 1 and check the size of the rootfs. If it is above 500M then it is likely your USB

CSaero
Rookie Tonidoid
Rookie Tonidoid
Posts: 4
Joined: Tue Aug 21, 2012 8:38 pm

Re: Reseting the Tonidoplug2

Postby CSaero » Wed Aug 22, 2012 9:09 pm

Thank you for your reply.

It looks like I'm booting off my 8GB usb drive. Here is the command line output I'm getting:

Code: Select all

root@TonidoPlug2:~# df -h /
Filesystem            Size  Used Avail Use% Mounted on
rootfs                7.6G  711M  6.5G  10% /
root@TonidoPlug2:~#  ubiattach /dev/ubi_ctrl -m 3
ubiattach: error!: cannot attach mtd3
           error 17 (File exists)
root@TonidoPlug2:~# mount -t ubifs ubi0:rootfs /mnt/
mount: ubi0:rootfs already mounted or /mnt/ busy
mount: according to mtab, ubi0:rootfs is already mounted on /mnt
root@TonidoPlug2:~# cd /mnt
root@TonidoPlug2:/mnt# rm -rf *
rm: cannot remove `bin/ls': Read-only file system
rm: cannot remove `bin/nc': Read-only file system
rm: cannot remove `bin/mt': Read-only file system
rm: cannot remove `bin/mv': Read-only file system
rm: cannot remove `bin/ps': Read-only file system
rm: cannot remove `bin/rm': Read-only file system
rm: cannot remove `bin/sh': Read-only file system
rm: cannot remove `bin/su': Read-only file system
rm: cannot remove `bin/zegrep': Read-only file system
rm: cannot remove `bin/cat': Read-only file system
rm: cannot remove `bin/dir': Read-only file system
rm: cannot remove `bin/pwd': Read-only file system
rm: cannot remove `bin/sed': Read-only file system
rm: cannot remove `bin/tar': Read-only file system
rm: cannot remove `bin/zfgrep': Read-only file system
rm: cannot remove `bin/zforce': Read-only file system
rm: cannot remove `bin/mountpoint': Read-only file system
rm: cannot remove `bin/bash': Read-only file system
rm: cannot remove `bin/dash': Read-only file system
rm: cannot remove `bin/date': Read-only file system
rm: cannot remove `bin/cpio': Read-only file system
rm: cannot remove `bin/echo': Read-only file system
rm: cannot remove `bin/grep': Read-only file system
rm: cannot remove `bin/gzip': Read-only file system
rm: cannot remove `bin/kill': Read-only file system
rm: cannot remove `bin/nano': Read-only file system
rm: cannot remove `bin/more': Read-only file system
rm: cannot remove `bin/ping': Read-only file system
rm: cannot remove `bin/stty': Read-only file system
rm: cannot remove `bin/sync': Read-only file system
rm: cannot remove `bin/true': Read-only file system
rm: cannot remove `bin/vdir': Read-only file system
rm: cannot remove `bin/zcat': Read-only file system
rm: cannot remove `bin/zcmp': Read-only file system
rm: cannot remove `bin/znew': Read-only file system
rm: cannot remove `bin/netstat': Read-only file system
rm: cannot remove `bin/gunzip': Read-only file system
rm: cannot remove `bin/tempfile': Read-only file system
^C
root@TonidoPlug2:/mnt#




Next I try to use another usb drive for booting, so I reboot using the internal flash and begin following the instructions on http://www.tonido.com/communitywiki/doku.php?id=advanceduses:usbboot. I now get different output from the instructions.

Code: Select all

root@TonidoPlug2:~# df -h /
Filesystem            Size  Used Avail Use% Mounted on
-                     450M  449M     0 100% /
root@TonidoPlug2:~# umount /media/disk1part1
can't create lock file /etc/mtab~1252: Read-only file system (use -n flag to override)
root@TonidoPlug2:~# Last login: Wed Aug 22 01:38:49 2012 from dir-615.home
root@TonidoPlug2:~# /etc/init.d/samba stop
Stopping Samba daemons: nmbd smbd.
root@TonidoPlug2:~# umount /media/disk1part1
can't create lock file /etc/mtab~1217: Read-only file system (use -n flag to override)
root@TonidoPlug2:~# umount -n /media/disk1part1
umount: /media/disk1part1: not mounted
root@TonidoPlug2:~# mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
root@TonidoPlug2:~#


Are other there other options I could try?

Tuxedo
Tonido Team
Tonido Team
Posts: 1458
Joined: Wed Jan 28, 2009 11:30 pm

Re: Reseting the Tonidoplug2

Postby Tuxedo » Sat Aug 25, 2012 10:04 pm

Couple of things:
1) Looks like your internal flash is corrupted. ie., it is mounting as read only.
2) Boot with your 8GB HDD. Check where your internal flash is mounted. From your previous post, it seems that you've mounted it on /mnt/
Now if you cant rm -rf files, probably the internal flash partition is mounted read only.
Try to mount it in read-write mode.
# mount /mnt/ -o rw,remount

CSaero
Rookie Tonidoid
Rookie Tonidoid
Posts: 4
Joined: Tue Aug 21, 2012 8:38 pm

Re: Reseting the Tonidoplug2

Postby CSaero » Sun Aug 26, 2012 9:34 pm

Seems like remounting has no effect, so far:

Code: Select all

root@TonidoPlug2:/mnt# mount /mnt/ -o rw,remount
root@TonidoPlug2:/mnt#  rm -rf *
rm: cannot remove `bin/ls': Read-only file system
rm: cannot remove `bin/nc': Read-only file system
rm: cannot remove `bin/mt': Read-only file system
rm: cannot remove `bin/mv': Read-only file system
rm: cannot remove `bin/ps': Read-only file system
rm: cannot remove `bin/rm': Read-only file system
...
^C
root@TonidoPlug2:/mnt#


The 8GB usb I'm using seems to be flaky, half the time it will boot with the usb stick and the other half the internal flash.

I decided to created a new 2GB bootable usb using a linux machine (Linux Mint distro). In the command line, I could not use parted, so I used qParted. While trying to wget and untar the files, I needed to use sudo to override permissions. I hope this is normal on a linux machine setup.

The new 2GB stick managed to boot up on the first try, but I ran into the same problem when I try to remove the files:

Code: Select all

root@TonidoPlug2:~# df -h /
Filesystem            Size  Used Avail Use% Mounted on
rootfs                1.9G  436M  1.4G  25% /
root@TonidoPlug2:~# ubiattach /dev/ubi_ctrl -m 3
UBI device number 0, total 4031 LEBs (520095744 bytes, 496.0 MiB), available 86 LEBs (11096064 bytes, 10.6 MiB), LEB size 129024 bytes (126.0 KiB)
root@TonidoPlug2:~# mount -t ubifs ubi0:rootfs /mnt/
root@TonidoPlug2:~#  cd /mnt
root@TonidoPlug2:/mnt#  rm -rf *
rm: cannot remove `bin/ls': Invalid argument
rm: cannot remove `bin/nc': Read-only file system
rm: cannot remove `bin/mt': Read-only file system
rm: cannot remove `bin/mv': Read-only file system
rm: cannot remove `bin/ps': Read-only file system
...
^C
root@TonidoPlug2:/mnt# mount /mnt/ -o rw,remount
root@TonidoPlug2:/mnt#  rm -rf *
rm: cannot remove `bin/ls': Read-only file system
rm: cannot remove `bin/nc': Read-only file system
rm: cannot remove `bin/mt': Read-only file system
rm: cannot remove `bin/mv': Read-only file system
rm: cannot remove `bin/ps': Read-only file system
...
^C
root@TonidoPlug2:/mnt#


Any more suggestions?
Thank you

CSaero
Rookie Tonidoid
Rookie Tonidoid
Posts: 4
Joined: Tue Aug 21, 2012 8:38 pm

Re: Reseting the Tonidoplug2

Postby CSaero » Mon Aug 27, 2012 6:39 pm

Ok, I managed to reset the internal flash by "Fixing a Corrupt NAND Partition" with the 2GB usb stick.

Code: Select all

root@TonidoPlug2:/#  apt-get update && apt-get upgrade.
Get:1 http://ftp.us.debian.org squeeze Release.gpg [1,672 B]
Ign http://ftp.us.debian.org/debian/ squeeze/contrib Translation-en
Get:2 http://security.debian.org squeeze/updates Release.gpg [836 B]
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en_US
Ign http://ftp.us.debian.org/debian/ squeeze/contrib Translation-en_US
Ign http://ftp.us.debian.org/debian/ squeeze/main Translation-en
Ign http://ftp.us.debian.org/debian/ squeeze/main Translation-en_US
Ign http://ftp.us.debian.org/debian/ squeeze/non-free Translation-en
Ign http://ftp.us.debian.org/debian/ squeeze/non-free Translation-en_US
Get:3 http://ftp.us.debian.org squeeze Release [111 kB]
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_US
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en_US
Get:4 http://security.debian.org squeeze/updates Release [86.9 kB]
Get:5 http://ftp.us.debian.org squeeze/main armel Packages [6,424 kB]
Get:6 http://security.debian.org squeeze/updates/main armel Packages [250 kB]
Get:7 http://security.debian.org squeeze/updates/contrib armel Packages [674 B]
Get:8 http://security.debian.org squeeze/updates/non-free armel Packages [14 B]
Get:9 http://ftp.us.debian.org squeeze/contrib armel Packages [45.1 kB]                   
Get:10 http://ftp.us.debian.org squeeze/non-free armel Packages [83.1 kB]                 
Fetched 7,003 kB in 38s (181 kB/s)                                                       
Reading package lists... Done
E: Invalid operation upgrade.
root@TonidoPlug2:/# mtdinfo
Count of MTD devices:           4
Present MTD devices:            mtd0, mtd1, mtd2, mtd3
Sysfs interface supported:      yes
root@TonidoPlug2:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00180000 00020000 "u-boot"
mtd1: 00020000 00020000 "u-boot-env"
mtd2: 00600000 00020000 "uImage"
mtd3: 1f800000 00020000 "rootfs"
root@TonidoPlug2:/# ubidetach /dev/ubi_ctrl -m 3
ubidetach: error!: cannot detach mtd3
           error 19 (No such device)
root@TonidoPlug2:/#  ubiformat /dev/mtd3 -s 512
ubiformat: mtd3 (nand), size 528482304 bytes (504.0 MiB), 4032 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 4031 -- 100 % complete 
ubiformat: 4031 eraseblocks have valid erase counter, mean value is 14
ubiformat: bad eraseblocks: 2712
ubiformat: formatting eraseblock 4031 -- 100 % complete 
root@TonidoPlug2:/#  ubiattach /dev/ubi_ctrl -m 3
UBI device number 0, total 4031 LEBs (520095744 bytes, 496.0 MiB), available 3987 LEBs (514418688 bytes, 490.6 MiB), LEB size 129024 bytes (126.0 KiB)
root@TonidoPlug2:/#  ubimkvol /dev/ubi0 -N rootfs -m
Set volume size to 514418688
Volume ID 0, size 3987 LEBs (514418688 bytes, 490.6 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs", alignment 1
root@TonidoPlug2:/#  mount -t ubifs ubi0:rootfs /mnt
root@TonidoPlug2:/#  cd /mnt
root@TonidoPlug2:/mnt#  wget http://www.tonido.com/downloads/plug2/rootfs.tar.gz
--2012-08-28 05:24:06--  http://www.tonido.com/downloads/plug2/rootfs.tar.gz
Resolving www.tonido.com... 50.97.134.197
Connecting to www.tonido.com|50.97.134.197|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 114062750 (109M) [application/x-gzip]
Saving to: ârootfs.tar.gzâ

100%[=================================================>] 114,062,750 1.57M/s   in 79s     

2012-08-28 05:25:26 (1.38 MB/s) - ârootfs.tar.gzâsaved [114062750/114062750]


The internal flash seemed to be about 30% full, so it appears to be fixed!

Tuxedo
Tonido Team
Tonido Team
Posts: 1458
Joined: Wed Jan 28, 2009 11:30 pm

Re: Reseting the Tonidoplug2

Postby Tuxedo » Wed Aug 29, 2012 12:17 am

Nice..


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 25 guests