Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: How to make your root partition visible under windows network

  1. #11
    Join Date
    Dec 2009
    Location
    ON, Canada
    Posts
    4,905

    Default

    Quote Originally Posted by jdc View Post
    Hi,

    Is this hack still valid / works with P70R2 or P70R2mega?

    thanks

    jdc
    should work with semi-official. Path files might need to be revised though, please share your findings once done.

    Best of luck,
    [*]Still new..? check the wiki. [*]Your shares gone for no reason ? Create a machine shortcut. [*]Trashing the G-adapter? upgrade cheaply to N. [*]Getting the hang of it? get organized .. add share shortcuts. [*]Getting sick of it ? it never hurts to rant here [*]Wishing for the time machine? give your PBO a makeover. [*]Bricked it while doing so ? unbrick it for $5[*]Not into cross flashing? keep it semi-official [*]Too lazy to read all that ? you asked for it.[*] Thank U PBO

  2. #12

    Default

    Quote Originally Posted by wigout View Post
    So changes made to the smb.conf persist for what seem like about 1 day. Then they get overwritten.

    As I often reboot/powerdown my pbo, it's not a big deal.

    But I wanted to understand what was happening. So I looked into the configsamba file (of foxeye's mod fame) to see what goodness it did.

    I think it's the key. I think it periodically is retriggered to write the smb.conf anew. (I don't understand under what circumstances configsamba is rerun).

    Anyway, as I want the root to mount with out much funny business, I simply added the lines I wanted in the smb.conf files to the configsamba file- which then echoes my additions to the smb_user.conf and smb_anonymous.conf files.

    But wait a minute, my slow brain eventually asked- why isn't the configsamba adding to the smb.conf file? However will my changes end up in the smb.file?

    The key is in the
    /tmp/package/script/samba-security anonymous
    command at the end of the script.

    Code:
    / # cat /tmp/package/script/samba-security
    #!/bin/sh
    #
    # description: modify the samba security level
    
    
    anonymous() {
            cp -f /tmp/package/samba/lib/smb_anonymous.conf /tmp/package/samba/lib/smb.conf
            RETVAL=$?
            echo
            return $RETVAL
    }
    
    user() {
            echo -e "123\n123" >/usr/local/etc/dvdplayer/tmpfile_samba
            /tmp/package/samba/sbin/smbpasswd -a admin -s</usr/local/etc/dvdplayer/tmpfile_samba >/dev/null 2>&1
            rm -f /usr/local/etc/dvdplayer/tmpfile_samba
            cp -f /tmp/package/samba/lib/smb_user.conf /tmp/package/samba/lib/smb.conf
            RETVAL=$?
            echo
            return $RETVAL
    }
    
    case "$1" in
      anonymous)
            anonymous
            ;;
      user)
            user
            ;;
      *)
            echo $"Usage: $0 {anonymous|user}"
            exit 1
    esac
    
    exit $?
    / #
    Following the script along, we find that the "samba-security" script has been invoked with the "anonymous" option, so the smb_anonymous.conf is then written over onto the /tmp/package/samba/lib/smb.conf file.



    So here's the improved process and code:
    On Firmware 4, you will have to free up some memory so you can make symbolic links and such- follow the instructions "Custom Root Partition Size" or face the dreaded memory allocation error.

    Then:
    Code:
    cd /usr/local/etc/
    touch configsamba
    chmod +x configsamba
    Open up configsamba with vi, copy and paste the code below:

    Code:
    #!/bin/sh
    #
    # description: create the samba conf file
    
    # if smb.conf already exist,nothing need to be done
    #if [ -e /tmp/package/samba/lib/smb.conf ]
    #then
    #   echo "smb conf already exist"
    #   exit 0
    #fi
    
    if [ -d /tmp/smb ]
    then
        echo ""
    else
        mkdir /tmp/smb
    fi
    
    cp /tmp/package/samba/conf/smb_anonymous_head.conf /tmp/package/samba/lib/smb_anonymous.conf
    cp /tmp/package/samba/conf/smb_user_head.conf /tmp/package/samba/lib/smb_user.conf
    
    str=$(ls /tmp/ramfs/volumes/)
    cd /tmp/ramfs/volumes/
    
    if [ $# -gt 0 ]
    then
        str=$(ls $1)
        cd $1
    fi
    
    for i in $str
    do
        path=$(readlink -f $i)
        echo $path
        mountpoint=$(cat /proc/mounts|grep $path |cut -d" " -f 2)
        carrier=$(cat /sys/class/net/eth0/carrier)
        echo $carrier
    
        if [ $# -gt 1 ]
        then
                mount -o remount,$2 $mountpoint
                echo "remount $2"
        else
            if [ -f /sys/class/net/eth0/carrier ] && [ $(cat /sys/class/net/eth0/carrier) -eq 1 ]
            then
                echo "remount rw"
                mount -o remount,rw $mountpoint
            else
                if [ -f /sys/class/net/wlan0/carrier ] && [ $(cat /sys/class/net/wlan0/carrier) -eq 1 ]
                then
                    echo "remount rw"
                    mount -o remount,rw $mountpoint
                else
                    echo "remount ro"
                    mount -o remount,ro $mountpoint
                fi
            fi
        fi
    
    # || [ -f /sys/class/net/wlan0/carrier ] && [$(cat /sys/class/net/wlan/carrier | echo) -eq '1' ];
        sharename=$(echo $i | cut -d":" -f 1)
        echo $sharename
        echo "[$sharename]" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "path=$mountpoint" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "hide dot files=yes" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "hide files=/.*/lost+found/">>/tmp/package/samba/lib/smb_anonymous.conf
        echo "guest ok=yes" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "writable=yes " >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "force create mode=0775 " >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "force directory mode=0775 " >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "[$sharename]" >>/tmp/package/samba/lib/smb_user.conf
        echo "path=$mountpoint" >>/tmp/package/samba/lib/smb_user.conf
        echo "hide dot files=yes" >>/tmp/package/samba/lib/smb_user.conf
        echo "hide files=/.*/lost+found/">>/tmp/package/samba/lib/smb_user.conf
        echo "guest ok=no" >>/tmp/package/samba/lib/smb_user.conf
        echo "writable=yes " >>/tmp/package/samba/lib/smb_user.conf
        echo "force create mode=0775 " >>/tmp/package/samba/lib/smb_user.conf
        echo "force directory mode=0775 " >>/tmp/package/samba/lib/smb_user.conf
    done
    
    #Start show root partition edits
        echo "[root]" >>/tmp/package/samba/lib/smb_user.conf
        echo "path=./" >>/tmp/package/samba/lib/smb_user.conf
        echo "hide dot files=no" >>/tmp/package/samba/lib/smb_user.conf
        echo "hide files=/.*/lost+found/">>/tmp/package/samba/lib/smb_user.conf
        echo "guest ok=yes" >>/tmp/package/samba/lib/smb_user.conf
        echo "writable=yes " >>/tmp/package/samba/lib/smb_user.conf
        echo "force create mode=0775 " >>/tmp/package/samba/lib/smb_user.conf
        echo "force directory mode=0775 " >>/tmp/package/samba/lib/smb_user.conf
        echo "[root]" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "path=./" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "hide dot files=no" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "hide files=/.*/lost+found/">>/tmp/package/samba/lib/smb_anonymous.conf
        echo "guest ok=yes" >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "writable=yes " >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "force create mode=0775 " >>/tmp/package/samba/lib/smb_anonymous.conf
        echo "force directory mode=0775 " >>/tmp/package/samba/lib/smb_anonymous.conf
    #End show root partition edits
    
    /tmp/package/script/samba-security anonymous
    exit 0
    Then:

    Code:
    mv /usr/local/bin/package/script/configsamba  /usr/local/etc/configsamba_bak
    ln -s /usr/local/etc/configsamba /usr/local/bin/package/script/
    reboot and enjoy perpetual access to your pbo's root partition over the network.
    Hi guys, im new to the forum and im attempting the hack described in this post to unhide the root directory of my PBO on my home network. In the steps described above by wigout, i am unable to move the existing 'configsamba' file from /usr/local/bin/package/script as i encounter a message from the prompt stating "unable to remove 'configsamba' : read only file system". This is rather strange in my oppinion as i currently have the P70R2 BCN firmware installed on my PBO and as far as i understand from reading all the content relating to it, the file system it uses allows read and write permissions. Can someone please tell me what could be causing this to happen? Cheers.

  3. #13
    Join Date
    Dec 2009
    Location
    Canada (ON)
    Posts
    2,075

    Default

    Quote Originally Posted by karlhoffman_76 View Post
    Hi guys, im new to the forum and im attempting the hack described in this post to unhide the root directory of my PBO on my home network. In the steps described above by wigout, i am unable to move the existing 'configsamba' file from /usr/local/bin/package/script as i encounter a message from the prompt stating "unable to remove 'configsamba' : read only file system". This is rather strange in my oppinion as i currently have the P70R2 BCN firmware installed on my PBO and as far as i understand from reading all the content relating to it, the file system it uses allows read and write permissions. Can someone please tell me what could be causing this to happen? Cheers.
    P70R2 (BCN) root "/" is writable but still get mounted as read-only on boot up. You need to remount it as a read/write partition using the following command:

    Code:
    # mount -o remount,rw /
    Good luck.

  4. #14

    Default

    Quote Originally Posted by snappy46 View Post
    P70R2 (BCN) root "/" is writable but still get mounted as read-only on boot up. You need to remount it as a read/write partition using the following command:

    Code:
    # mount -o remount,rw /
    Good luck.
    Confirmed...works with P02R2 BCN...for now.

    PS, I modified the partition sizes for both the root and mtblock file systems. Changed root from 0x8a00000 to 0x8000000 and mtblock from 0x1200000 to 0x2800000. Just in case that had some bearing on anything.
    Last edited by karlhoffman_76; 01-14-2012 at 02:14 AM.

  5. #15
    Join Date
    Jan 2010
    Posts
    132

    Default

    Any chance of someone figuring out how to do this with MedeBo fw? I'm using Shizzl mod 3.2, and I got the FTP service to access the root partition, but it's clumsy and slow. I really enjoyed this root partition hack when I had PBO fw.

  6. #16
    Join Date
    Jan 2010
    Posts
    132

    Default

    Problem solved for Medebo fw, and probably for PBO firmwares (w/ yaffs). I simply removed configsamba (thereby preventing it from messing up other files) and then edited the smb.conf as indicated in post #1. I now have Windows read/write access to root, hdd, and usb drives.

    What IS the purpose of configsamba, anyway? The unit seems to run perfectly fine without it.

  7. #17
    Join Date
    Dec 2009
    Location
    Canada (ON)
    Posts
    2,075

    Default

    Quote Originally Posted by jamaroney View Post
    Problem solved for Medebo fw, and probably for PBO firmwares (w/ yaffs). I simply removed configsamba (thereby preventing it from messing up other files) and then edited the smb.conf as indicated in post #1. I now have Windows read/write access to root, hdd, and usb drives.

    What IS the purpose of configsamba, anyway? The unit seems to run perfectly fine without it.
    configsamba is required to share mounts automatically on boot up and I also think when a new device is inserted in the USB port. If you look at the script you'll see that it first store the directories in /tmp/ramfs/volumes/ ; any storage devices is mounted there including HDD. The script takes that list that correspond to each device and create the proper smb conf file for those mount. That means that when the samba server is started then all the devices mounted there will be available on your PC. By removing this file "configsamba" if you connect a new storage device to your PBO that device will no longer be added automatically to the samba conf. file hence will not be seen on the PC thru the samba server.

    In a nutshell "configsamba" creates a new smb conf on start up based upon what you have connected to your PBO.

    Cheers !!!

  8. #18
    Join Date
    Jan 2010
    Posts
    132

    Default

    Does this apply only to PBO fw? I ask because in my MedeBO fw I added root and usb drives to my smb.conf (and removed sambaconfig), and they always show up on my PC, even when I insert the usb drive after PBO startup.

  9. #19
    Join Date
    Dec 2009
    Location
    Canada (ON)
    Posts
    2,075

    Default

    Quote Originally Posted by jamaroney View Post
    Does this apply only to PBO fw? I ask because in my MedeBO fw I added root and usb drives to my smb.conf (and removed sambaconfig), and they always show up on my PC, even when I insert the usb drive after PBO startup.
    I can not say for sure about the Medebo fw since I never really used it; however it is normal for you to see both your USB Drive + root on your PBO since you already add them manually to your smb.conf therefore they are shared no matter when the USB Drive is inserted. configsamba is the program that normally run on boot up or "when a new mounted device is added ???" and you remove it. Therefore if you were for example to add another extra USB Drive to the PBO then that drive would not be seen on the samba server until you add it manually to the smb.conf file just like you did for the first USB drive and root since configsamba has been removed.

    Snappy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •