Moving / directory in linux
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-
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
add a comment |
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-
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
This conversation has been moved to chat.
– Michael Mrozek♦
Dec 28 '18 at 1:02
add a comment |
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-
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
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-
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
ubuntu partition root-filesystem
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
Let's follow these steps:
BACKUP ALL IMPORTED FILES
=========================================
Overall Process
- Backup you Ubuntu system
- Identify UUID of new partition
- Modify /etc/fstab to mount new partition
- Copy old root (
/
) to new location /media/new_root - Confirm copy worked
- Switch root mount point in /etc/fstab
- Remount all entries in the /etc/fstab
- Delete the /media/new_root
==========================================
Identify the UUID of the new partition to use with the command
sudo blkid
Setup /etc/fstab
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compares the two version
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
Create that mount point
sudo mkdir /media/new_root
Mount
/dev/sda12
on/media/new_root
sudo mount -a
Copy over
/
sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.
Check the copying worked
sudo diff -r / /media/new_root -x ".gvfs/*"
Perform final switch
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 theUUID
value.
Now remount to see if all went well
sudo mount -a
Troubleshoot:
The volume may already be mounted:
sudo umount /media/new_root
sudo mount -a
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
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Let's follow these steps:
BACKUP ALL IMPORTED FILES
=========================================
Overall Process
- Backup you Ubuntu system
- Identify UUID of new partition
- Modify /etc/fstab to mount new partition
- Copy old root (
/
) to new location /media/new_root - Confirm copy worked
- Switch root mount point in /etc/fstab
- Remount all entries in the /etc/fstab
- Delete the /media/new_root
==========================================
Identify the UUID of the new partition to use with the command
sudo blkid
Setup /etc/fstab
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compares the two version
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
Create that mount point
sudo mkdir /media/new_root
Mount
/dev/sda12
on/media/new_root
sudo mount -a
Copy over
/
sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.
Check the copying worked
sudo diff -r / /media/new_root -x ".gvfs/*"
Perform final switch
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 theUUID
value.
Now remount to see if all went well
sudo mount -a
Troubleshoot:
The volume may already be mounted:
sudo umount /media/new_root
sudo mount -a
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
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
add a comment |
Let's follow these steps:
BACKUP ALL IMPORTED FILES
=========================================
Overall Process
- Backup you Ubuntu system
- Identify UUID of new partition
- Modify /etc/fstab to mount new partition
- Copy old root (
/
) to new location /media/new_root - Confirm copy worked
- Switch root mount point in /etc/fstab
- Remount all entries in the /etc/fstab
- Delete the /media/new_root
==========================================
Identify the UUID of the new partition to use with the command
sudo blkid
Setup /etc/fstab
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compares the two version
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
Create that mount point
sudo mkdir /media/new_root
Mount
/dev/sda12
on/media/new_root
sudo mount -a
Copy over
/
sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.
Check the copying worked
sudo diff -r / /media/new_root -x ".gvfs/*"
Perform final switch
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 theUUID
value.
Now remount to see if all went well
sudo mount -a
Troubleshoot:
The volume may already be mounted:
sudo umount /media/new_root
sudo mount -a
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
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
add a comment |
Let's follow these steps:
BACKUP ALL IMPORTED FILES
=========================================
Overall Process
- Backup you Ubuntu system
- Identify UUID of new partition
- Modify /etc/fstab to mount new partition
- Copy old root (
/
) to new location /media/new_root - Confirm copy worked
- Switch root mount point in /etc/fstab
- Remount all entries in the /etc/fstab
- Delete the /media/new_root
==========================================
Identify the UUID of the new partition to use with the command
sudo blkid
Setup /etc/fstab
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compares the two version
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
Create that mount point
sudo mkdir /media/new_root
Mount
/dev/sda12
on/media/new_root
sudo mount -a
Copy over
/
sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.
Check the copying worked
sudo diff -r / /media/new_root -x ".gvfs/*"
Perform final switch
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 theUUID
value.
Now remount to see if all went well
sudo mount -a
Troubleshoot:
The volume may already be mounted:
sudo umount /media/new_root
sudo mount -a
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
Let's follow these steps:
BACKUP ALL IMPORTED FILES
=========================================
Overall Process
- Backup you Ubuntu system
- Identify UUID of new partition
- Modify /etc/fstab to mount new partition
- Copy old root (
/
) to new location /media/new_root - Confirm copy worked
- Switch root mount point in /etc/fstab
- Remount all entries in the /etc/fstab
- Delete the /media/new_root
==========================================
Identify the UUID of the new partition to use with the command
sudo blkid
Setup /etc/fstab
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compares the two version
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
Create that mount point
sudo mkdir /media/new_root
Mount
/dev/sda12
on/media/new_root
sudo mount -a
Copy over
/
sudo rsync -aXS --progress --exclude='/*/.gvfs' /. /media/new_root/.
Check the copying worked
sudo diff -r / /media/new_root -x ".gvfs/*"
Perform final switch
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 theUUID
value.
Now remount to see if all went well
sudo mount -a
Troubleshoot:
The volume may already be mounted:
sudo umount /media/new_root
sudo mount -a
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
This conversation has been moved to chat.
– Michael Mrozek♦
Dec 28 '18 at 1:02