November 21, 2024, 11:21:03 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: reg hardlink across partitions  (Read 10086 times)

Offline deep123

  • Linux Noob !
  • *
  • Posts: 4
reg hardlink across partitions
« on: April 29, 2005, 06:54:30 AM »
Hi,
Is it possible to have a hard link across partitions....
I need to take a data from one partition and write to to another partitions..If any modification of file done in Partition 1 ,it should be immediately reflected in partition2..I came to know hard link might work.... Is there any other way to do that... Kindly suggest me a solution...Thanks in Advance.

Offline Gray

  • Linux Noob !
  • *
  • Posts: 5
reg hardlink across partitions
« Reply #1 on: May 09, 2005, 02:08:01 PM »
It is possible, but that partition have to be mounted on your file system and local to your machine.

Alternatively you can use a soft link to the file after mounting it.

Offline deep123

  • Linux Noob !
  • *
  • Posts: 4
reg hardlink across partitions
« Reply #2 on: May 10, 2005, 05:13:46 AM »
HI ,
         i have mounted the partition and  tried for hardlink a file to that partition say
         ln  /home/deepam/1.c     /mnt/mnt/backup/1.c

the partition is mounted on /mnt/mnt/backup.....

but it throws an error saying "Invalid Cross-device link"...

Offline Gray

  • Linux Noob !
  • *
  • Posts: 5
reg hardlink across partitions
« Reply #3 on: May 10, 2005, 06:32:14 AM »
Try this

ln -s /home/deepam/1.c /mnt/mnt/backup/1.c

the -s switch makes it a soft link. Hope it works.

Let me know your result.

Offline deep123

  • Linux Noob !
  • *
  • Posts: 4
reg hardlink across partitions
« Reply #4 on: May 10, 2005, 09:16:46 AM »
Ya..its works fine for soft link...but  when the source file is deleted then backup copy will also get deleted....I have to try for hard link...
Whenever i try for hard link it throws an error "Invalid device terminal"..how to solve it

Offline Gray

  • Linux Noob !
  • *
  • Posts: 5
reg hardlink across partitions
« Reply #5 on: May 11, 2005, 09:13:15 AM »
Only that you need immediate reflection in your backup else you  could schedule a copy of the desired file(s), Hard links from my knowledge can't achieve what you require.

Offline deep123

  • Linux Noob !
  • *
  • Posts: 4
reg hardlink across partitions
« Reply #6 on: May 12, 2005, 05:40:45 AM »
thanks for ur reply  :D