PDA

View Full Version : Mounting and read-only .... Oleg firmware 1.9.2.7-9



nanomir
22-11-2008, 13:46
Hi all, had a few troubles understanding the filesystem after flashing for first time with Oleg firmware, so here are my notes:

With a USB disk in Asus WL 500g, and Samba active with hidden read/write:
access from Windows as "\\WL-ASUS\disc0_1" - can read, but cannot write (if it is hidden read/write)
access from Windows as "\\WL-ASUS\disc0_1$" - can write on a hidden read/write, but seems to remount the disc0_1 mount in the telnet shell as "ro" read-only

So, trying to copy a file from a telnet shell session to disc0_1, once it has been accessed from Windows as disc0_1$, notifies a problem:

[admin@WL-ASUS root]$ cp /usr/bin/ipkg.sh /tmp/mnt/disc0_1
cp: unable to open `/tmp/mnt/disc0_1/ipkg.sh': Read-only file system

Accidentally, my disc0_5 partition was still rw, so I tried to mount /opt to a directory there - mount --bind command works...


[admin@WL-ASUS root]$ mkdir /tmp/mnt/disc0_5/optasus
[admin@WL-ASUS root]$ mount --bind /tmp/mnt/disc0_5/optasus/ /opt/
[admin@WL-ASUS root]$ mount
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
ramfs on /tmp type ramfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part1 on /tmp/mnt/disc0_1 type vfat (ro,noatime)
/dev/discs/disc0/part5 on /tmp/mnt/disc0_5 type vfat (rw,noatime)
/dev/discs/disc0/part6 on /tmp/mnt/disc0_6 type vfat (rw,noatime)
/dev/discs/disc0/part7 on /tmp/mnt/disc0_7 type ntfs (ro)
/dev/discs/disc0/part5 on /opt type vfat (rw,noatime)

Regardless of what mount says, all is ok with directories - the following saves in dir /tmp/mnt/disc0_5/optasus:

[admin@WL-ASUS root]$ echo "blabla" > /opt/blabla.txt

Cheers...


EDIT: Well, for mount commands, better to check tutorials like
How to update DynDNS behind a modem - AsusForum.NET -- WL500g (http://wl500g.info/showthread.php?p=109028) which then refers to Ipkg - WL-HDD Wiki (http://wlhdd.co.uk/wiki/Ipkg); or the instructions at NSLU2-Linux - Applications / SlimServer browse (http://www.nslu2-linux.org/wiki/Applications/SlimServer)

nanomir
24-11-2008, 00:03
Well, it seems it was not that easy - at a certain point I tried to "Force to Eject USB Disk" from "USB Application - FTP Server" in the web applet; after noticing the shares still show up in Windows (but they are "samba", not "ftp" - does that make a difference?) I tried to umount manually via telnet... Eventually I took the cable out, and connected again...

Now /dev/discs/disc0/part1 was not mounted; trying to mount it manually resulted with "mounting failed - invalid argument"; that partition now shows up as RAW in Windows and "unallocated" in gParted.

As recommended in Save a Hard Disk gone RAW - for free - Morgan Creative (http://www.morgan.net.au/index.php?option=com_content&task=view&id=14&Itemid=21), I tried following TestDisk Step By Step (http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step), and I did manage to recover a different partition (what should have been "/dev/discs/disc0/part3" above, I guess) but the very first partition doesn't show up.

So I guess, my problem is now - is the method I tried (with the $) dangerous; or was "mount --bind" to /opt dangerous; or was my disk simply problematic from before?

While there - what does "Hidden Read/Write" option actually mean in Samba / Default Access Level? I couldn't find anything useful googling for "Hidden Read/Write" + Samba (http://www.google.com/search?q="Hidden+Read%2FWrite"+Samba), apart from this Czech post (http://translate.google.com/translate?u=http%3A%2F%2Fwww.koppel.cz%2Fconferenc es%2Fviewtopic.php%3Ft%3D1191&hl=en&ie=UTF-8&sl=cs&tl=en):
Yes accesses the disk
\\myrouter\share\
or
\\myrouter\share$


which is where I got my idea about $ access from - but nothing more clear than that ....

Any suggestions? Thanks....

nanomir
24-11-2008, 01:05
Well, good news :) - thankfully, managed to recover the original missing partition, using the instructions here: TestDisk Wiki - Data Recovery Examples: 5 Two FAT32 partitions to recover (http://www.cgsecurity.org/wiki/Data_Recovery_Examples#Two_FAT32_partitions_to_rec over) (and additionally after that, running fsck on any visible partition under Ubuntu, and running chkdsk /F /V /R /X in any visible partition under XP)... good I remembered its original format was FAT32 :)

So, thankfully, no loss here - but how to avoid such occurrences? If I was certain that the disk was corrupt before, then OK ... But is my way of accessing hidden read/write OK? Should I even use hidden read/write if I want to write to partitions? Can any reading be recommended with advice about this ???

Thanks....

al37919
24-11-2008, 07:05
I can only say that:
/dev/discs/disc0/part5 on /opt type vfat (rw,noatime)
is anyway a useless idea. To install programs in linux ext2/3 is needed, as fat32 doesn't support required features like symlinks, permissions etc.

nanomir
06-12-2008, 21:48
Hi al37919,

Thanks for your response!!

/opt type vfat (rw,noatime)
is anyway a useless idea. To install programs in linux ext2/3 is needed, as fat32 doesn't support required features like symlinks, permissions etc.

You're absolutely right - I have experienced the same problems when trying to use fat partitions for Ubuntu... But I keep on forgetting that, being a windozer :)

Anyways, could you clarify (or point a reading) about the behavior of "Hidden Read/Write" option, and whether I should use "$" to access such partitions, when I'd want to write to them?

Thanks ... Cheers!