<div dir="ltr">Hello again,<br><br>Tim was the closest to an answer, but I think I got even more confused...<br><br>Here is what I have:<br><br>A 160 GB HDD with one primary partition formated as ext3. this partition contains all of my media files in an alphabetized hierarchy - 8814 files in 904 directories.<br>

<br>Another hierarchy I'd like to link the actual files by categories:<br><br>/Data/Artwork/<br>|-- Audio<br>|-- Extras<br>|-- Movies<br>|-- Music Video Clips<br>|-- TV<br>|-- Video<br>|-- Visuals<br>`-- eTexts<br><br>

Some directories contain a both video and audio, so I'd like to link some of the files to the Audio and some to the Video categories.<br><br>I currently have only 11GB free, and I'd like to minimize the waste of space, so here are my questions:<br>

<br>I understand hard links will not delete be a problem as long as I check the link count with ls -l. They will also save space because soft links are broken and stay there as a separate entity in the FS and just take up space.<br>

<br>I'd like to know what would be the best way to link the files from the alphabetized hierarchy to the category hierarchy. <br><br>Is there a way to covert soft links to hard links? I I use Konqueror to drag a bunch of files from directory to directory I can then choose to (soft) link them....<br>

<br>I also need help with the Bash script. I don't know much on scripting....<br><br>Thanks!<br><br>.:====================================================:.<br><br>Amichai Rotman<br><br>UIN#: 6401746<br>Registered Linux User#: 201192 [<a href="http://counter.li.org/">http://counter.li.org/</a>]<br>

Registered Ubuntu User #12851 [<a href="http://ubuntucounter.geekosophical.net">http://ubuntucounter.geekosophical.net</a>]<br><br>------------------------------------------------------------------------------------------------------------<br>

<br>PLEASE READ: <a href="http://www.gnu.org/philosophy/no-word-attachments.html">http://www.gnu.org/philosophy/no-word-attachments.html</a><br><br>------------------------------------------------------------------------------------------------------------<br>

<br>.:====================================================:.<br><a href="http://www.brainyquote.com/quotes/authors/g/george_carlin.html" target="_blank">George Carlin</a>  - "Frisbeetarianism is the belief that when you die, your soul goes up on the roof and gets stu...
<br><br><div class="gmail_quote">On Tue, Apr 14, 2009 at 21:53, Kyle Smith <span dir="ltr"><<a href="mailto:kyle.smith@inforonics.com">kyle.smith@inforonics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




  

<div bgcolor="#ffffff" text="#000099"><div class="im">
<br>
Smoot Carl-Mitchell wrote:
<blockquote type="cite">
  <pre>On Tue, 2009-04-14 at 19:45 +1200, Tim Frost wrote:

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre>Is it possible to create a hard link to a directory somehow?
      </pre>
    </blockquote>
    <pre>No. In general, a directory is a container, and as such it defines a
place in the tree which holds files (and other directories).  That
container only makes sense in that one place in the tree.
    </pre>
  </blockquote>
  <pre>Hardlinks to directories are not allowed, except when creating a
directory.  A hard link is created to a new directory's parent directory
with the name ".." and linked to itself with the name ".".  This
standard is the way the utilities walk up the filesystem hierarchy.  The
"/" directory has the ".." hardlink point to itself.

This is the only case where hardlinks to directories appear in the
filesystem hierarchy.  Some Unices do allow userland programs to create
directory hardlinks, but it is inadvisable to do this, since many of the
standard utilities depend on this not being the case.  You can see the
hardlink count with the ls -la command. The -a lets you see the
directory links and all the hidden files in a directory.  The link count
is the number after the permissions.  A directory with lots of
subdirectories will have a lot of hardlinks.  Adding "-i" as an option
will let you display the inode number which is the only unique
identifier for each file.
  </pre>
</blockquote></div>
Apparently you all haven't had the pleasure of working with cPanel's
WHM product.  WHM uses something called virtfs to create chroot
environments for users to SSH into, and for SuEXEC PHP scripts to run
inside.  What's fantastic about how they do it is that they hardlink
the /home/username directory inside /home/virtfs/username/home/, and
they hardlink the /lib directory in /home/virtfs/username/lib.  What's
especially great about this is that you do some cleanup of accounts and
write yourself a little script to remove home directories not owned by
current users, next thing you know rm -r hits /home/virtfs and you
remove /lib/ldlinux.so.2.<br>
<br>
Wanna know a fun error message?<br>
bash: ls: ELF Interpreter not found: /lib/ldlinux.so.2<br>
<br>
That is why directories shouldn't be hardlinked.  :)<br>
<br>
- Kyle<br>
</div>

<br>--<br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
<br></blockquote></div><br></div>