Bit bucket directory - Unix

This is a discussion on Bit bucket directory - Unix ; Hello, Is there a way to have a "black hole" directory, like /dev/null is a "black hole" file. Let's call such a directory /dev/nulldir. Anything written to nulldir would disappear, and return success. Background : I want to scp multiple ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Bit bucket directory

  1. Bit bucket directory

    Hello,

    Is there a way to have a "black hole" directory, like /dev/null is a
    "black hole" file.

    Let's call such a directory /dev/nulldir. Anything written to nulldir
    would disappear, and return success.

    Background : I want to scp multiple large files to a remote system
    that has very limited disk space. (I'm testing scp behavior.)

    $ scp xx1 xx2 root@10.10.10.241:/dev/null
    scp: /dev/null: Not a directory

    I'd want to write...

    $ scp xx1 xx2 root@10.10.10.241:/dev/nulldir

    and have it work :-)

    Any ideas? Or some other way to look at the problem?

    (My OS is Linux 2.6.22)

    Regards.

  2. Re: Bit bucket directory

    Noob wrote:
    > Hello,
    >
    > Is there a way to have a "black hole" directory, like /dev/null is a
    > "black hole" file.
    >
    > Let's call such a directory /dev/nulldir. Anything written to nulldir
    > would disappear, and return success.
    >
    > Background : I want to scp multiple large files to a remote system that
    > has very limited disk space. (I'm testing scp behavior.)
    >
    > $ scp xx1 xx2 root@10.10.10.241:/dev/null
    > scp: /dev/null: Not a directory
    >
    > I'd want to write...
    >
    > $ scp xx1 xx2 root@10.10.10.241:/dev/nulldir
    >
    > and have it work :-)
    >
    > Any ideas? Or some other way to look at the problem?
    >
    > (My OS is Linux 2.6.22)
    >
    > Regards.



    I would create my own file system using fuse.sf.net .

  3. Re: Bit bucket directory

    Frank Mertens wrote:

    > Noob wrote:
    >
    >> Is there a way to have a "black hole" directory, like /dev/null is a
    >> "black hole" file.
    >>
    >> Let's call such a directory /dev/nulldir. Anything written to nulldir
    >> would disappear, and return success.
    >>
    >> Background : I want to scp multiple large files to a remote system
    >> that has very limited disk space. (I'm testing scp behavior.)
    >>
    >> $ scp xx1 xx2 root@10.10.10.241:/dev/null
    >> scp: /dev/null: Not a directory
    >>
    >> I'd want to write...
    >>
    >> $ scp xx1 xx2 root@10.10.10.241:/dev/nulldir
    >>
    >> and have it work :-)
    >>
    >> Any ideas? Or some other way to look at the problem?
    >>
    >> (My OS is Linux 2.6.22)

    >
    > I would create my own file system using fuse.sf.net


    I had hoped for a "quick and dirty" solution.
    I wouldn't consider writing my own file system "quick".
    ^_^

  4. Re: Bit bucket directory

    Noob wrote:
    >> I would create my own file system using fuse.sf.net

    > I had hoped for a "quick and dirty" solution.
    > I wouldn't consider writing my own file system "quick".
    > ^_^


    But very(!) dirty

  5. Re: Bit bucket directory

    Noob wrote:

    > Is there a way to have a "black hole" directory, like /dev/null is a
    > "black hole" file.
    >
    > Let's call such a directory /dev/nulldir. Anything written to nulldir
    > would disappear, and return success.
    >
    > Background : I want to scp multiple large files to a remote system that
    > has very limited disk space. (I'm testing scp behavior.)
    >
    > $ scp xx1 xx2 root@10.10.10.241:/dev/null
    > scp: /dev/null: Not a directory
    >
    > I'd want to write...
    >
    > $ scp xx1 xx2 root@10.10.10.241:/dev/nulldir
    >
    > and have it work :-)
    >
    > Any ideas? Or some other way to look at the problem?
    >
    > (My OS is Linux 2.6.22)


    No cookie? :-)

  6. Re: Bit bucket directory

    Noob writes:

    > Noob wrote:
    >
    >> Is there a way to have a "black hole" directory, like /dev/null is a
    >> "black hole" file.
    >> Let's call such a directory /dev/nulldir. Anything written to
    >> nulldir would disappear, and return success.
    >> Background : I want to scp multiple large files to a remote system
    >> that has very limited disk space. (I'm testing scp behavior.)
    >> $ scp xx1 xx2 root@10.10.10.241:/dev/null
    >> scp: /dev/null: Not a directory
    >> I'd want to write...
    >> $ scp xx1 xx2 root@10.10.10.241:/dev/nulldir
    >> and have it work :-)
    >> Any ideas? Or some other way to look at the problem?
    >> (My OS is Linux 2.6.22)

    >
    > No cookie? :-)


    http://thread.gmane.org/gmane.linux.kernel/639765

    --
    Måns Rullgård
    mans@mansr.com

  7. Re: Bit bucket directory

    Noob wrote:
    > Is there a way to have a "black hole" directory, like /dev/null is a
    > "black hole" file.
    >
    > Let's call such a directory /dev/nulldir. Anything written to nulldir
    > would disappear, and return success.
    >
    > Background : I want to scp multiple large files to a remote system that
    > has very limited disk space. (I'm testing scp behavior.)


    Depending on what it is about scp behavior you're testing, how about
    creating a mirror image of the directory hierarchy, but with smaller
    files?

    Something like this:

    cd /bigdir
    mkdir /tmp/smalldir
    find . -depth -type d -print | ( cd /tmp/smalldir && cpio -pdmv )
    find . -type f -print | while read f
    do
    dd if="$f" of=/tmp/smalldir/"$f" bs=512 count=1
    done

    Now you should have a similar directory hierarchy but with only the
    first 512 bytes of the original files. It won't be an exact mirror
    because the file ownership will be different, but that might be good
    enough.

    - Logan

+ Reply to Thread