[RESOLVED] Reset root password in NAND

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[RESOLVED] Reset root password in NAND

Postby ubermacin » Sun Jan 20, 2013 7:02 am

I have Arch working like a champ on a USB thumb drive on my E02 pogoplug. I rebooted without the thumb drive to create another Arch thumb drive for messing around with. However, it seems my NAND root password is not any of the usual suspects (root, ceadmin). I now vaguely recall setting a password on my.pogoplug.com when I registered the device. Now I can't log in. I've been looking at https://wiki.archlinux.org/index.php/Password_Recovery but I don't know which dev to mount to look at the shadow. Am I toast or is there something I'm missing? :|
Last edited by ubermacin on Wed Jan 23, 2013 5:49 am, edited 1 time in total.
ubermacin
 
Posts: 13
Joined: Fri Jan 18, 2013 6:56 pm

Re: Reset root password in NAND

Postby moonman » Sun Jan 20, 2013 8:41 am

For mounting I read that you need ubiattach and then mount but ubiattach isn't found and I didn't really try to figure it out any futher. TO reinstall you don't need to boot into stock os. Follow the link in my signature.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Reset root password in NAND

Postby ubermacin » Sun Jan 20, 2013 2:05 pm

Thanks Moonman! I am still concerned that I can't get into my NAND root account. Is there a script that will load a third-party image onto the NAND with a known root password? As in, maybe Jeff's recovery system?
ubermacin
 
Posts: 13
Joined: Fri Jan 18, 2013 6:56 pm

Re: Reset root password in NAND

Postby xenoxaos » Mon Jan 21, 2013 4:11 pm

All you need to do to make a new rootfs is to format the flash drive ext2, and extract the rootfs as root....simple as that.
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Re: Reset root password in NAND

Postby ubermacin » Tue Jan 22, 2013 3:49 am

Thanks xenoxaos, if I understand what you're saying, format an extra thumbdrive to ext2, extract rootfs from the E02, then modify? I'm sorry if I'm not following along. As a side note, I found this forum post that looked promising: viewtopic.php?f=18&t=3490&hilit=ubifs&start=10, but I got "mount: special device /dev/mtdblock2 does not exist" and then it was suggested to me to try:

mkdir /tmp/pogo
mount -t ubifs -o rw ubi0:rootfs /tmp/pogo

From there, edit the shadow file. But that also was a dead end, evidently alarm doesn't support ubifs or at least, I can't find a package that does.
ubermacin
 
Posts: 13
Joined: Fri Jan 18, 2013 6:56 pm

Re: Reset root password in NAND

Postby WarheadsSE » Tue Jan 22, 2013 3:54 am

pacman -Sy mtd-utils
$this->bbcode_second_pass_code('', '
pacman -Ql mtd-utils | grep ubi
mtd-utils /usr/sbin/mkfs.ubifs
mtd-utils /usr/sbin/ubiattach
mtd-utils /usr/sbin/ubicrc32
mtd-utils /usr/sbin/ubidetach
mtd-utils /usr/sbin/ubiformat
mtd-utils /usr/sbin/ubimkvol
mtd-utils /usr/sbin/ubinfo
mtd-utils /usr/sbin/ubinize
mtd-utils /usr/sbin/ubirename
mtd-utils /usr/sbin/ubirmvol
mtd-utils /usr/sbin/ubirsvol
mtd-utils /usr/sbin/ubiupdatevol
')
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Reset root password in NAND

Postby ubermacin » Tue Jan 22, 2013 4:49 am

Thanks Warheads, I feel like I'm getting closer, this was the output:

$this->bbcode_second_pass_code('', '
[root@alarm ~]# pacman -Sy mtd-utils
:: Synchronizing package databases...
core 40.4 KiB 254K/s 00:00 [#################################] 100%
extra 454.1 KiB 1167K/s 00:00 [#################################] 100%
community 469.8 KiB 960K/s 00:00 [#################################] 100%
alarm 5.0 KiB 3.88M/s 00:00 [#################################] 100%
aur 13.9 KiB 271K/s 00:00 [#################################] 100%
warning: mtd-utils-1.5.0-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (1): mtd-utils-1.5.0-1

Total Installed Size: 0.75 MiB
Net Upgrade Size: 0.00 MiB

Proceed with installation? [Y/n] y
(1/1) checking package integrity [#################################] 100%
(1/1) loading package files [#################################] 100%
(1/1) checking for file conflicts [#################################] 100%
(1/1) checking available disk space [#################################] 100%
(1/1) upgrading mtd-utils [#################################] 100%
[root@alarm ~]# pacman -Ql mtd-utils | grep ubi
mtd-utils /usr/sbin/mkfs.ubifs
mtd-utils /usr/sbin/ubiattach
mtd-utils /usr/sbin/ubicrc32
mtd-utils /usr/sbin/ubidetach
mtd-utils /usr/sbin/ubiformat
mtd-utils /usr/sbin/ubimkvol
mtd-utils /usr/sbin/ubinfo
mtd-utils /usr/sbin/ubinize
mtd-utils /usr/sbin/ubirename
mtd-utils /usr/sbin/ubirmvol
mtd-utils /usr/sbin/ubirsvol
mtd-utils /usr/sbin/ubiupdatevol
[root@alarm ~]# mkdir /tmp/pogo
mkdir: cannot create directory ‘/tmp/pogo’: File exists
[root@alarm ~]# mount -t ubifs -o rw ubi0:rootfs /tmp/pogo
mount: unknown filesystem type 'ubifs'
[root@alarm ~]#
')
I had found mtd-utils before and tried the install, but I assumed it wasn't what I was looking for earlier. What is strange is when I do:
$this->bbcode_second_pass_code('', '
[root@alarm ~]# cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cgroup
nodev cpuset
nodev tmpfs
nodev devtmpfs
nodev binfmt_misc
nodev debugfs
nodev securityfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev anon_inodefs
nodev devpts
ext3
ext2
ext4
cramfs
nodev ramfs
vfat
msdos
nodev jffs2
nodev aufs
nodev mqueue
nodev mtd_inodefs
nodev ubifs
nodev autofs
')
it DOES list ubifs (nodev means it doesn't have to be a block device right?)
Last edited by WarheadsSE on Tue Jan 22, 2013 2:38 pm, edited 1 time in total.
Reason: CODE TAGS
ubermacin
 
Posts: 13
Joined: Fri Jan 18, 2013 6:56 pm

Re: Reset root password in NAND

Postby moonman » Tue Jan 22, 2013 9:21 am

you should be able to

$this->bbcode_second_pass_code('', 'ubiattach /dev/ubi_ctrl -m 2')

only then run mount. But ubiattach errors out
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Reset root password in NAND

Postby ubermacin » Tue Jan 22, 2013 1:06 pm

Sure enough, here are my results:

$this->bbcode_second_pass_code('', '[root@alarm ~]# ubiattach /dev/ubi_ctrl -m 2
ubiattach: error!: cannot attach mtd2
error 22 (Invalid argument)
[root@alarm ~]# mount -t ubifs -o rw ubi0:rootfs /tmp/pogo
mount: unknown filesystem type 'ubifs'')

dmesg:
$this->bbcode_second_pass_code('', '[193749.366933] UBI: attaching mtd2 to ubi0
[193749.366950] UBI: physical eraseblock size: 131072 bytes (128 KiB)
[193749.366961] UBI: logical eraseblock size: 129024 bytes
[193749.366969] UBI: smallest flash I/O unit: 2048
[193749.366977] UBI: sub-page size: 512
[193749.366986] UBI: VID header offset: 512 (aligned 512)
[193749.366995] UBI: data offset: 2048
[193749.405141] UBI: max. sequence number: 0
[193749.405157] UBI error: ubi_read_volume_table: the layout volume was not found')

So does that mean it's a bug in the package? Have I hit a dead end?
ubermacin
 
Posts: 13
Joined: Fri Jan 18, 2013 6:56 pm

Re: Reset root password in NAND

Postby moonman » Tue Jan 22, 2013 7:45 pm

There you go:
$this->bbcode_second_pass_code('', 'mknod /dev/mtdblock2 b 31 2
mount -t jffs2 -o rw /dev/mtdblock2 /mnt')

Everything should show up under mnt. Be careful not to mess things up :D

$this->bbcode_second_pass_code('', 'chroot /mnt
passwd root')
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 10 guests