Visit Our UNIX and Linux User Community


Cannot link to a file on another device


 
Thread Tools Search this Thread
Operating Systems AIX Cannot link to a file on another device
# 1  
Old 06-05-2011
Cannot link to a file on another device

Hello,

I'm trying to move a file using ftp command

rename filename /new/filesystem/filename

but I'm getting the error Cannot link to a file on another device. When it says 'device' what exactly does that mean? Physical or logical? Is there anyway to display and find a suitable drive.

Thanks

ps. The reason I'm using ftp is that's the only id (apart from root which I haven't got) that can move the file. None of my unix I.D's have permission..
# 2  
Old 06-06-2011
A "device" is everything with an entry in /dev. In fact this entry in /dev is the device as far as the system is concerned. This is one of the most basic tenets in Unix.

Perhaps you want a less axiomatic answer, so here is the long version:

The kernel doesn't interact with hardware itself but leaves this task to drivers. Drivers are mostly loadable kernel modules (they become part of the kernel image when they are loaded) and their task is twofold: they have to drive the hardware and they have to offer interfaces to the other processes.

Lets have an example: consider a disk driver. Some process wants to write data, so the disk driver has to have some way of getting told by the process about the data to be written. On the other hand it has to translate this to some low-level commands the disk understands (SCSI commands for SCSI disks or ST-506 commands for ancient MFM disks or whatever).

We are interested in the interfacing to other processes here. This is in Unix traditionally done by an entry in /dev. It acts quite similar to any file: writing to there means telling the device driver to transfer data to this device, reading from there tells the device driver to get data from the device. This principle is the same for most devices: writing to /dev/tty<x> means to have this written to the screen of the respective terminal, reading from there means waiting for keyboard input; writing to (do NOT TRY THIS!) /dev/hd<x> means writing to this disk, reading from there means reading the disks data; and so on.

What does that mean for your question? When the LVM (Logical Volume Manager) creates an LV (a "Logical Volume", basically a [virtual] disk) it creates an entry /dev/hd<x> which represents this disk. Later you tell the filesystem driver (a higher driver level, which operates on top of the LVM) to "mount" this device somewhere, which basically means to make the content of the device accessible via filesystem means.

The "rename" facility in "ftp" is what its name suggests: a means to rename (but not move!) a file. To rename it means to change the contents of its inode. (This is the place where the filesystem stores some vital information about every file - including its name.) But if you "rename" the file from one filesystem to another you have to physically move the contents of the file from one disk to another disk. This means not altering the files inode, but moving the file, deleting the old inode and creating a new one on the new filesystem.

Usually Unix does a very good job in blurring this distinction, because "mv" will do both and in principle a user should not be bothered with how the filesystems are mounted. This is one of the few occasions where the distinction is made.

What you can do: get yourself the permission for the file to move it. There is no other way, otherwise Unix would not be the epitome of a secure OS it in fact is. If someone lacks permission for a specific task it should not and must not be possible to circumvent it - period. Works as designed.

I hope this helps.

bakunin
# 3  
Old 06-06-2011
Thanks Bakunin

Thanks for that - some stuff there I sort of knew but you've clarified some things. As for 'rename' it is the ftp version of move. I know that because I tested it before trying on the prodbox. I issued the command 'rename filename /new/directory/newfilename' and then logged into that box to see the file had in fact been moved. I think the problem is something to do with a symbolic or hard link with that file. Cheers
# 4  
Old 06-06-2011
If the file on prodbox is a hard link, you cannot "rename it" to another filesystem.
Hard links only work within a given filesystem.
This User Gave Thanks to jim mcnamara For This Post:

Previous Thread | Next Thread
Test Your Knowledge in Computers #618
Difficulty: Medium
Python is strongly object-oriented in the sense that everything is an object including numbers, strings and even functions.
True or False?

7 More Discussions You Might Find Interesting

1. HP-UX

Failed to open tape device /dev/rmt/0mn:Device busy (errno = 16)

Hi, Unable to make tape backup, please help. /opt/ignite/bin/make_tape_recovery -a /dev/rmt/?mn -I -v -m tar -x inc_entire=vg00 * Creating local directories for configuration files and archive. ======= 04/25/16 16:28:08 IST Started /opt/ignite/bin/make_tape_recovery. (Mon... (4 Replies)
Discussion started by: anuragr
4 Replies

2. Solaris

/var/adm/messages (insterface turned off/restored) and link up & link down message.

Hi All I am facing an issue with our new solaris machine. in /var/adm/messages Apr 22 16:43:05 Prod-App1 in.routed: interface net0 to 172.16.101.1 turned off Apr 22 16:43:33 Prod-App1 mac: NOTICE: nxge0 link up, 1000 Mbps, full duplex Apr 22 16:43:34 Prod-App1 mac: NOTICE: nxge0 link... (2 Replies)
Discussion started by: javeedkaleem
2 Replies

3. Solaris

/var/adm/messages (interface turned off/restored) and link up & link down message.

Hi All I am facing an issue with our new solaris machine. in /var/adm/messages root@Prod-App1:/var/tmp# root@Prod-App1:/var/tmp# root@Prod-App1:/var/tmp# cat /var/adm//messages Apr 20 03:10:01 Prod-App1 syslogd: line 25: WARNING: loghost could not be resolved Apr 20 08:24:18 Prod-App1... (0 Replies)
Discussion started by: javeedkaleem
0 Replies

4. Red Hat

Unable To Activate Ethernet Network Device in RHEL 5.5 - e100 device eth0 does not seem to be presen

Hi All, Could anyone please help to resolve the below problem. I installed RHEL5.5 in my desktop.But when i try to activate the ethernet connection then it gives me the error. I spent 2 days for the above and go through with several suggestion found by googling. But no luck. ... (0 Replies)
Discussion started by: Tanmoy
0 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Symbolic link not allowed or link target not accessible

Hi everybody, I read about treads realted to this issue but they did not resovle issue given below. Please help me resolve issue given below I have html file under /srv/www/htdocs/actual_folder ls actual_folder/ test.html and following link works... (0 Replies)
Discussion started by: newbielgn
0 Replies

6. Programming

g++ fails to link to static library when compilation and link in single command

Hello All, I've encountered a strange behaviour from g++ that doesn't make sense to me. Maybe you can shed some light on it: I have a bunch of source files and want to compile them and link them with a static library liba.a located in /usr/local/lib64 into an executable Approach 1 works... (0 Replies)
Discussion started by: magelord
0 Replies

7. UNIX for Dummies Questions & Answers

Difference between hard link and soft link in unix

Hi All, Can any one please explain me what is the difference between hard link and soft link in UNIX. Thanks in advance Raja Chokalingam. (2 Replies)
Discussion started by: RAJACHOKALINGAM
2 Replies

Featured Tech Videos