DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-06-15 22:44:55

sulan
Member
Registered: 2010-04-02
Posts: 17

Can't cd to existing directory

I'm on a DNS-323 with FW 1.08 and funplug 0.5. I ran into the problem below and I can't figure out what is wrong. The directory /mnt/HD_a2/Backup/ exists and contains my backupdata, but I can't cd to it from /mnt/HD_a2/ffp/ as shown below.

root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
-sh: cd: can't cd to ../Backup/
root@bfoto:/mnt/HD_a2/ffp# cd /mnt/HD_a2/Backup/
root@bfoto:/mnt/HD_a2/Backup#

Does this have something to do with the fact that / is mounted as something called rootfs (ramdisk?),  I also include the output from `mount`:
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw,nodiratime)
/dev/loop0 on /sys/crfs type squashfs (ro)
/dev/sda2 on /mnt/HD_a2 type ext3 (rw)
/dev/sdb2 on /mnt/HD_b2 type ext3 (rw)
/dev/sda4 on /mnt/HD_a4 type ext3 (rw)
/dev/sdb4 on /mnt/HD_b4 type ext3 (rw)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)

Anyone else experiencing this?

Last edited by sulan (2010-06-15 22:47:13)

Offline

 

#2 2010-06-16 05:09:44

JamesD
Member
Registered: 2009-05-23
Posts: 10

Re: Can't cd to existing directory

sulan wrote:

I'm on a DNS-323 with FW 1.08 and funplug 0.5. I ran into the problem below and I can't figure out what is wrong. The directory /mnt/HD_a2/Backup/ exists and contains my backupdata, but I can't cd to it from /mnt/HD_a2/ffp/ as shown below.

root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
-sh: cd: can't cd to ../Backup/
root@bfoto:/mnt/HD_a2/ffp# cd /mnt/HD_a2/Backup/
root@bfoto:/mnt/HD_a2/Backup#

Does this have something to do with the fact that / is mounted as something called rootfs (ramdisk?),  I also include the output from `mount`:
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw,nodiratime)
/dev/loop0 on /sys/crfs type squashfs (ro)
/dev/sda2 on /mnt/HD_a2 type ext3 (rw)
/dev/sdb2 on /mnt/HD_b2 type ext3 (rw)
/dev/sda4 on /mnt/HD_a4 type ext3 (rw)
/dev/sdb4 on /mnt/HD_b4 type ext3 (rw)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)

Anyone else experiencing this?

Try eliminating the ../
for example:

cd /mnt/HD_a2
cd Backup

or:

cd /mnt/HD_a2/Backup

either should work...

Jim

Offline

 

#3 2010-06-16 12:17:04

sulan
Member
Registered: 2010-04-02
Posts: 17

Re: Can't cd to existing directory

Thanks for the hint, but I might have posted a wrong title on this post. I can access the directory under some conditions but not from others. If I for instance previously have made a cd to /ffp/ then I can't cd to ../Backup. However, if I first cd to /mnt/HD_a2/ffp/ then it is possible to cd to ../Backup

Here is some output from my shell:
root@bfoto:~# cd /ffp/
root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
-sh: cd: can't cd to ../Backup/
root@bfoto:/mnt/HD_a2/ffp# cd /mnt/HD_a2/ffp/
root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
root@bfoto:/mnt/HD_a2/Backup#

Even though this is not a big problem I would like to know why this is so.

Offline

 

#4 2010-06-16 12:37:39

JamesD
Member
Registered: 2009-05-23
Posts: 10

Re: Can't cd to existing directory

sulan wrote:

Thanks for the hint, but I might have posted a wrong title on this post. I can access the directory under some conditions but not from others. If I for instance previously have made a cd to /ffp/ then I can't cd to ../Backup. However, if I first cd to /mnt/HD_a2/ffp/ then it is possible to cd to ../Backup

Here is some output from my shell:
root@bfoto:~# cd /ffp/
root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
-sh: cd: can't cd to ../Backup/
root@bfoto:/mnt/HD_a2/ffp# cd /mnt/HD_a2/ffp/
root@bfoto:/mnt/HD_a2/ffp# cd ../Backup/
root@bfoto:/mnt/HD_a2/Backup#

Even though this is not a big problem I would like to know why this is so.

You're right, I get the same behaviour. I'm not hugely familiar with linux... it might be that the /ffp is actually a link to /mnt/HD_a2/ffp. So you are backing up the link. So as far as the path is concerned, /mnt/HD_a2/Backups is a completely different part of the directory tree from /ffp.

I think I'll do some research on hard and soft links...

Jim

Offline

 

#5 2010-06-16 15:48:04

sulan
Member
Registered: 2010-04-02
Posts: 17

Re: Can't cd to existing directory

Okay, then we know that is isn't just a local error in my dns323. I hope we can figure out what the reason is.

Offline

 

#6 2010-06-16 16:26:57

JamesD
Member
Registered: 2009-05-23
Posts: 10

Re: Can't cd to existing directory

From what I can see, the ffp in  / is a soft link, equivalent to a windows shortcut. So when you  cd /ffp, you ar following a shortcut to the actual directory. The system doesn't know (or care?) what the actual path is. So when you cd ../Backup,  you are changing to the parent directory of the link (shortcut) rather than the parent directory of the actual path.

http://linuxgazette.net/105/pitcher.html
http://www.linuxclues.com/articles/17.htm

Jim
(durn, now I've learned something...) smile

Offline

 

#7 2010-06-17 00:06:01

sulan
Member
Registered: 2010-04-02
Posts: 17

Re: Can't cd to existing directory

Allright, thanks (and great that you also learned something wink

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB