LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 03-12-2006, 03:02 AM   #1
silindrin
LQ Newbie
 
Registered: Aug 2004
Distribution: Knoppix 4.0, Debian Sarge
Posts: 3

Rep: Reputation: 0
symlink directory eats files


There's something I'm not understanding about symlinking to a directory that's causing my files to disappear. I've partitioned my hard disk for purposes of keeping data and the OS separate. My intention was to make symlinks in my home directory to other directories so that I can type (for example) ~/sounds instead of /mnt/sda5/sounds, but it will still physically store everything in ~/sounds on my data partition. I tried to do this by first creating /mnt/sda5/sounds, and then typing (from my home directory):

ln -s /mnt/sda5/sounds sounds

This seemed to work, but then I noticed that ~/sounds and /mnt/sda5/sounds actually had different files in them! Apparently when I saved or copied a file, it would go to one or the other, but not both. Then when I poked around more, one set of files seemed to overrule the other, and the other set of files just disappeared. (This has happened to me twice now, the second time while I was in the process of trying to back everything up.)

I read the man and info pages for ln but still can't figure out what's going on. Anyone else had this problem? Or is ln just not the proper tool for linking to directories?

Running a Debian-compatible HD install of Knoppix 4.0 (only way I could figure out to install to SATA) with 2.6.12 kernel.
 
Old 03-12-2006, 01:08 PM   #2
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
Try unmounting /mnt/sda5 and see if you still have a sounds directory in there. If so, move the out of that directory, remount and copy them back.
 
Old 03-13-2006, 03:53 AM   #3
silindrin
LQ Newbie
 
Registered: Aug 2004
Distribution: Knoppix 4.0, Debian Sarge
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you! My missing files reappeared when I unmounted /mnt/sda5. So Linux was actually saving sda5's files to sda1 when sda5 wasn't mounted? How do I keep it from doing that? Have it automatically mount sda5 at boot?
 
Old 03-13-2006, 09:28 AM   #4
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
Delete /mnt/sda5/sounds when sda5 is not mounted. Remount /mnt/sda5. Now whenever the sound directory is not there, you know it is not mounted. You could add a line to your /etc/fstab
/dev/sda5 /mnt/sda5 ext3 defaults 0 0
to ensure that it is mounted at boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
symlink-hook: error retrieving current directory: getcwd: cannot access parent dire sailu_mvn Linux - Software 1 03-09-2006 07:01 AM
symlink home-directory? SteQve Linux - General 2 01-26-2006 05:42 PM
how to remove a symlink without deleting the destination directory Snerkel Linux - Software 3 01-20-2005 12:47 PM
symlink multiple files to new directory with new extension jmanjohn61 Linux - General 1 01-06-2005 01:55 PM
moving a symlink in a directory e1000 Linux - General 2 02-23-2004 06:09 PM


All times are GMT -5. The time now is 03:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration