Moving / directory in linux












0














I installed ubuntu with dual boot alongside Windows 8. While partitioning I allocated 9.8 GB to the root directory of linux.Now i am short on space with only 700MB space remaining in this root directory. I cannot delete this OS because i have important application and files which run only on the Linux environment. Is there any way i can shift the root directory to another partition(I have an empty 17GB partition /dev/sda12 ) or increase the partition size?



This is how my partitions look like-



enter image description here



The error messgae when i boot into Windows is:



File : BootBCD
Status : 0xc000000e
Info : The boot configuration Data on your PC is missing or contains errors









share|improve this question
























  • This conversation has been moved to chat.
    – Michael Mrozek
    Dec 28 '18 at 1:02


















0














I installed ubuntu with dual boot alongside Windows 8. While partitioning I allocated 9.8 GB to the root directory of linux.Now i am short on space with only 700MB space remaining in this root directory. I cannot delete this OS because i have important application and files which run only on the Linux environment. Is there any way i can shift the root directory to another partition(I have an empty 17GB partition /dev/sda12 ) or increase the partition size?



This is how my partitions look like-



enter image description here



The error messgae when i boot into Windows is:



File : BootBCD
Status : 0xc000000e
Info : The boot configuration Data on your PC is missing or contains errors









share|improve this question
























  • This conversation has been moved to chat.
    – Michael Mrozek
    Dec 28 '18 at 1:02
















0












0








0







I installed ubuntu with dual boot alongside Windows 8. While partitioning I allocated 9.8 GB to the root directory of linux.Now i am short on space with only 700MB space remaining in this root directory. I cannot delete this OS because i have important application and files which run only on the Linux environment. Is there any way i can shift the root directory to another partition(I have an empty 17GB partition /dev/sda12 ) or increase the partition size?



This is how my partitions look like-



enter image description here



The error messgae when i boot into Windows is:



File : BootBCD
Status : 0xc000000e
Info : The boot configuration Data on your PC is missing or contains errors









share|improve this question















I installed ubuntu with dual boot alongside Windows 8. While partitioning I allocated 9.8 GB to the root directory of linux.Now i am short on space with only 700MB space remaining in this root directory. I cannot delete this OS because i have important application and files which run only on the Linux environment. Is there any way i can shift the root directory to another partition(I have an empty 17GB partition /dev/sda12 ) or increase the partition size?



This is how my partitions look like-



enter image description here



The error messgae when i boot into Windows is:



File : BootBCD
Status : 0xc000000e
Info : The boot configuration Data on your PC is missing or contains errors






ubuntu partition root-filesystem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago









Rui F Ribeiro

39.2k1479130




39.2k1479130










asked Dec 26 '18 at 6:01









Nobody

12




12












  • This conversation has been moved to chat.
    – Michael Mrozek
    Dec 28 '18 at 1:02




















  • This conversation has been moved to chat.
    – Michael Mrozek
    Dec 28 '18 at 1:02


















This conversation has been moved to chat.
– Michael Mrozek
Dec 28 '18 at 1:02






This conversation has been moved to chat.
– Michael Mrozek
Dec 28 '18 at 1:02












1 Answer
1






active

oldest

votes


















1














Let's follow these steps:



BACKUP ALL IMPORTED FILES



=========================================



Overall Process




  1. Backup you Ubuntu system

  2. Identify UUID of new partition

  3. Modify /etc/fstab to mount new partition

  4. Copy old root (/) to new location /media/new_root

  5. Confirm copy worked

  6. Switch root mount point in /etc/fstab

  7. Remount all entries in the /etc/fstab

  8. Delete the /media/new_root


==========================================





  1. Identify the UUID of the new partition to use with the command



    sudo blkid



  2. Setup /etc/fstab




    1. sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


    2. cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)



      Compares the two version




    3. Edit the old /etc/fstab, sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? /media/new_root ext defaults 0 2


      Replace UUID with the value for /dev/sda12 seen in step1 above






  3. Create that mount point



    sudo mkdir /media/new_root



  4. Mount /dev/sda12on /media/new_root



    sudo mount -a




    1. Copy over /



      sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.



    2. Check the copying worked



      sudo diff -r / /media/new_root -x ".gvfs/*"





  5. Perform final switch





    1. sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? / ext4 defaults 0 2




      • IMPORTANT: Add a # in front of the former entry in the /etc/fstab that was for the root mount i.e. /dev/sda10, please check and make sure you identify it using the UUID value.






  6. Now remount to see if all went well




    1. sudo mount -a


    2. Troubleshoot:





      1. The volume may already be mounted:



        sudo umount /media/new_root
        sudo mount -a







  7. Delete /media/new_root if all goes well.



    sudo rm -rI /media/new_root



Goodluck



Source:(modified)



https://help.ubuntu.com/community/Partitioning/Home/Moving






share|improve this answer























  • Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
    – Nobody
    Jan 1 at 7:00










  • So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
    – Nobody
    Jan 1 at 7:04











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',
autoActivateHeartbeat: false,
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%2f490935%2fmoving-directory-in-linux%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Let's follow these steps:



BACKUP ALL IMPORTED FILES



=========================================



Overall Process




  1. Backup you Ubuntu system

  2. Identify UUID of new partition

  3. Modify /etc/fstab to mount new partition

  4. Copy old root (/) to new location /media/new_root

  5. Confirm copy worked

  6. Switch root mount point in /etc/fstab

  7. Remount all entries in the /etc/fstab

  8. Delete the /media/new_root


==========================================





  1. Identify the UUID of the new partition to use with the command



    sudo blkid



  2. Setup /etc/fstab




    1. sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


    2. cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)



      Compares the two version




    3. Edit the old /etc/fstab, sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? /media/new_root ext defaults 0 2


      Replace UUID with the value for /dev/sda12 seen in step1 above






  3. Create that mount point



    sudo mkdir /media/new_root



  4. Mount /dev/sda12on /media/new_root



    sudo mount -a




    1. Copy over /



      sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.



    2. Check the copying worked



      sudo diff -r / /media/new_root -x ".gvfs/*"





  5. Perform final switch





    1. sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? / ext4 defaults 0 2




      • IMPORTANT: Add a # in front of the former entry in the /etc/fstab that was for the root mount i.e. /dev/sda10, please check and make sure you identify it using the UUID value.






  6. Now remount to see if all went well




    1. sudo mount -a


    2. Troubleshoot:





      1. The volume may already be mounted:



        sudo umount /media/new_root
        sudo mount -a







  7. Delete /media/new_root if all goes well.



    sudo rm -rI /media/new_root



Goodluck



Source:(modified)



https://help.ubuntu.com/community/Partitioning/Home/Moving






share|improve this answer























  • Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
    – Nobody
    Jan 1 at 7:00










  • So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
    – Nobody
    Jan 1 at 7:04
















1














Let's follow these steps:



BACKUP ALL IMPORTED FILES



=========================================



Overall Process




  1. Backup you Ubuntu system

  2. Identify UUID of new partition

  3. Modify /etc/fstab to mount new partition

  4. Copy old root (/) to new location /media/new_root

  5. Confirm copy worked

  6. Switch root mount point in /etc/fstab

  7. Remount all entries in the /etc/fstab

  8. Delete the /media/new_root


==========================================





  1. Identify the UUID of the new partition to use with the command



    sudo blkid



  2. Setup /etc/fstab




    1. sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


    2. cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)



      Compares the two version




    3. Edit the old /etc/fstab, sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? /media/new_root ext defaults 0 2


      Replace UUID with the value for /dev/sda12 seen in step1 above






  3. Create that mount point



    sudo mkdir /media/new_root



  4. Mount /dev/sda12on /media/new_root



    sudo mount -a




    1. Copy over /



      sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.



    2. Check the copying worked



      sudo diff -r / /media/new_root -x ".gvfs/*"





  5. Perform final switch





    1. sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? / ext4 defaults 0 2




      • IMPORTANT: Add a # in front of the former entry in the /etc/fstab that was for the root mount i.e. /dev/sda10, please check and make sure you identify it using the UUID value.






  6. Now remount to see if all went well




    1. sudo mount -a


    2. Troubleshoot:





      1. The volume may already be mounted:



        sudo umount /media/new_root
        sudo mount -a







  7. Delete /media/new_root if all goes well.



    sudo rm -rI /media/new_root



Goodluck



Source:(modified)



https://help.ubuntu.com/community/Partitioning/Home/Moving






share|improve this answer























  • Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
    – Nobody
    Jan 1 at 7:00










  • So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
    – Nobody
    Jan 1 at 7:04














1












1








1






Let's follow these steps:



BACKUP ALL IMPORTED FILES



=========================================



Overall Process




  1. Backup you Ubuntu system

  2. Identify UUID of new partition

  3. Modify /etc/fstab to mount new partition

  4. Copy old root (/) to new location /media/new_root

  5. Confirm copy worked

  6. Switch root mount point in /etc/fstab

  7. Remount all entries in the /etc/fstab

  8. Delete the /media/new_root


==========================================





  1. Identify the UUID of the new partition to use with the command



    sudo blkid



  2. Setup /etc/fstab




    1. sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


    2. cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)



      Compares the two version




    3. Edit the old /etc/fstab, sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? /media/new_root ext defaults 0 2


      Replace UUID with the value for /dev/sda12 seen in step1 above






  3. Create that mount point



    sudo mkdir /media/new_root



  4. Mount /dev/sda12on /media/new_root



    sudo mount -a




    1. Copy over /



      sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.



    2. Check the copying worked



      sudo diff -r / /media/new_root -x ".gvfs/*"





  5. Perform final switch





    1. sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? / ext4 defaults 0 2




      • IMPORTANT: Add a # in front of the former entry in the /etc/fstab that was for the root mount i.e. /dev/sda10, please check and make sure you identify it using the UUID value.






  6. Now remount to see if all went well




    1. sudo mount -a


    2. Troubleshoot:





      1. The volume may already be mounted:



        sudo umount /media/new_root
        sudo mount -a







  7. Delete /media/new_root if all goes well.



    sudo rm -rI /media/new_root



Goodluck



Source:(modified)



https://help.ubuntu.com/community/Partitioning/Home/Moving






share|improve this answer














Let's follow these steps:



BACKUP ALL IMPORTED FILES



=========================================



Overall Process




  1. Backup you Ubuntu system

  2. Identify UUID of new partition

  3. Modify /etc/fstab to mount new partition

  4. Copy old root (/) to new location /media/new_root

  5. Confirm copy worked

  6. Switch root mount point in /etc/fstab

  7. Remount all entries in the /etc/fstab

  8. Delete the /media/new_root


==========================================





  1. Identify the UUID of the new partition to use with the command



    sudo blkid



  2. Setup /etc/fstab




    1. sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


    2. cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)



      Compares the two version




    3. Edit the old /etc/fstab, sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? /media/new_root ext defaults 0 2


      Replace UUID with the value for /dev/sda12 seen in step1 above






  3. Create that mount point



    sudo mkdir /media/new_root



  4. Mount /dev/sda12on /media/new_root



    sudo mount -a




    1. Copy over /



      sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.



    2. Check the copying worked



      sudo diff -r / /media/new_root -x ".gvfs/*"





  5. Perform final switch





    1. sudo nano /etc/fstab



      # (identifier)  (location, eg sda5)   (format, eg ext3 or ext4)      (some settings) 
      UUID=???????? / ext4 defaults 0 2




      • IMPORTANT: Add a # in front of the former entry in the /etc/fstab that was for the root mount i.e. /dev/sda10, please check and make sure you identify it using the UUID value.






  6. Now remount to see if all went well




    1. sudo mount -a


    2. Troubleshoot:





      1. The volume may already be mounted:



        sudo umount /media/new_root
        sudo mount -a







  7. Delete /media/new_root if all goes well.



    sudo rm -rI /media/new_root



Goodluck



Source:(modified)



https://help.ubuntu.com/community/Partitioning/Home/Moving







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 27 '18 at 18:49

























answered Dec 26 '18 at 8:47









George Udosen

1,214319




1,214319












  • Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
    – Nobody
    Jan 1 at 7:00










  • So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
    – Nobody
    Jan 1 at 7:04


















  • Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
    – Nobody
    Jan 1 at 7:00










  • So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
    – Nobody
    Jan 1 at 7:04
















Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
– Nobody
Jan 1 at 7:00




Ok sorry for being late.First of all thanks.But i have some questions 1.I am mounting the /media/new_root at partition but when i am copying / to /media/new_root wont it go in a end less loop.Like it copies all the contents until it reaches /media, there when it tries to copy /new_root to the partition it is essentially recopying it self. Sorry if i am wrong im not very sound in linux filesystems, I just switched from windows so it is kind of new.
– Nobody
Jan 1 at 7:00












So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
– Nobody
Jan 1 at 7:04




So i ran out of space in that partition, and can I format that again, since i changed fstab to mount sda10 as /.
– Nobody
Jan 1 at 7:04


















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%2f490935%2fmoving-directory-in-linux%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

CARDNET

Boot-repair Failure: Unable to locate package grub-common:i386

濃尾地震