How to append a new disk to an existing folder

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a server with a program which rapidly writes data to a folder. I attached a new disk to the server, mounted it and now I want it to expand or replace the folder with data. The program works with hardcoded folder names and I don't really want to stop it copy the files to new disk and symlink them to address of the old folder.



My original way would be like this:



rsync -avxP --progress /data/oldsrc /mnt/newsrc/
rm -rf /data/oldsrc
ln -s /mnt/newsrc /data/oldsrc


Is there any way to do this without moving/copying old files, removing them from source and linking from new disk to old folder?



Edit: I need all the data in the old folder to be accessible by the program.










share|improve this question























  • Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
    – Panki
    Dec 7 at 9:29










  • @Panki i need all the data inside the old folder accessible. Editing my question.
    – Mustafa Yılmaz
    Dec 7 at 9:41










  • Is it an LVM filesystem structure? Kindly post the output of df -Th.
    – erTugRul
    Dec 7 at 9:53











  • @erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
    – Mustafa Yılmaz
    Dec 7 at 10:20











  • No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
    – Christopher
    Dec 10 at 14:56














up vote
0
down vote

favorite












I have a server with a program which rapidly writes data to a folder. I attached a new disk to the server, mounted it and now I want it to expand or replace the folder with data. The program works with hardcoded folder names and I don't really want to stop it copy the files to new disk and symlink them to address of the old folder.



My original way would be like this:



rsync -avxP --progress /data/oldsrc /mnt/newsrc/
rm -rf /data/oldsrc
ln -s /mnt/newsrc /data/oldsrc


Is there any way to do this without moving/copying old files, removing them from source and linking from new disk to old folder?



Edit: I need all the data in the old folder to be accessible by the program.










share|improve this question























  • Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
    – Panki
    Dec 7 at 9:29










  • @Panki i need all the data inside the old folder accessible. Editing my question.
    – Mustafa Yılmaz
    Dec 7 at 9:41










  • Is it an LVM filesystem structure? Kindly post the output of df -Th.
    – erTugRul
    Dec 7 at 9:53











  • @erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
    – Mustafa Yılmaz
    Dec 7 at 10:20











  • No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
    – Christopher
    Dec 10 at 14:56












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a server with a program which rapidly writes data to a folder. I attached a new disk to the server, mounted it and now I want it to expand or replace the folder with data. The program works with hardcoded folder names and I don't really want to stop it copy the files to new disk and symlink them to address of the old folder.



My original way would be like this:



rsync -avxP --progress /data/oldsrc /mnt/newsrc/
rm -rf /data/oldsrc
ln -s /mnt/newsrc /data/oldsrc


Is there any way to do this without moving/copying old files, removing them from source and linking from new disk to old folder?



Edit: I need all the data in the old folder to be accessible by the program.










share|improve this question















I have a server with a program which rapidly writes data to a folder. I attached a new disk to the server, mounted it and now I want it to expand or replace the folder with data. The program works with hardcoded folder names and I don't really want to stop it copy the files to new disk and symlink them to address of the old folder.



My original way would be like this:



rsync -avxP --progress /data/oldsrc /mnt/newsrc/
rm -rf /data/oldsrc
ln -s /mnt/newsrc /data/oldsrc


Is there any way to do this without moving/copying old files, removing them from source and linking from new disk to old folder?



Edit: I need all the data in the old folder to be accessible by the program.







linux rsync symlink storage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 7 at 9:42

























asked Dec 7 at 8:46









Mustafa Yılmaz

12




12











  • Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
    – Panki
    Dec 7 at 9:29










  • @Panki i need all the data inside the old folder accessible. Editing my question.
    – Mustafa Yılmaz
    Dec 7 at 9:41










  • Is it an LVM filesystem structure? Kindly post the output of df -Th.
    – erTugRul
    Dec 7 at 9:53











  • @erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
    – Mustafa Yılmaz
    Dec 7 at 10:20











  • No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
    – Christopher
    Dec 10 at 14:56
















  • Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
    – Panki
    Dec 7 at 9:29










  • @Panki i need all the data inside the old folder accessible. Editing my question.
    – Mustafa Yılmaz
    Dec 7 at 9:41










  • Is it an LVM filesystem structure? Kindly post the output of df -Th.
    – erTugRul
    Dec 7 at 9:53











  • @erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
    – Mustafa Yılmaz
    Dec 7 at 10:20











  • No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
    – Christopher
    Dec 10 at 14:56















Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
– Panki
Dec 7 at 9:29




Can't you unmount /data/oldsrc/and mount /mnt/newsrc instead?
– Panki
Dec 7 at 9:29












@Panki i need all the data inside the old folder accessible. Editing my question.
– Mustafa Yılmaz
Dec 7 at 9:41




@Panki i need all the data inside the old folder accessible. Editing my question.
– Mustafa Yılmaz
Dec 7 at 9:41












Is it an LVM filesystem structure? Kindly post the output of df -Th.
– erTugRul
Dec 7 at 9:53





Is it an LVM filesystem structure? Kindly post the output of df -Th.
– erTugRul
Dec 7 at 9:53













@erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
– Mustafa Yılmaz
Dec 7 at 10:20





@erTugRul nah it's an EXT4 drive. /dev/sda3 ext4 309G 286G 6,6G 98% /
– Mustafa Yılmaz
Dec 7 at 10:20













No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
– Christopher
Dec 10 at 14:56




No. You should stop the software that is writing. Then tar up the contents of the directory, delete the contents of the directory, mount the new disk in the directory, unpack the tar archive, and then start the software.
– Christopher
Dec 10 at 14:56















active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486535%2fhow-to-append-a-new-disk-to-an-existing-folder%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486535%2fhow-to-append-a-new-disk-to-an-existing-folder%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay