Reformat only the home partition
I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?
partitions
add a comment |
I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?
partitions
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
1
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08
add a comment |
I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?
partitions
I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?
partitions
partitions
asked Jan 14 at 8:19
teatea
506
506
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
1
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08
add a comment |
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
1
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
1
1
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08
add a comment |
1 Answer
1
active
oldest
votes
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –
Unmount the /home folder
$ umount /home
Reformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)
$ mkfs.ext4 -F /dev/sdXX
Mount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)
$ mount /home
Re-Create home folders for existing users.
$ cp -r /etc/skel /home/username
$ chown -R username:usergroup /home/username
That’s it.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f1109558%2freformat-only-the-home-partition%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
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –
Unmount the /home folder
$ umount /home
Reformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)
$ mkfs.ext4 -F /dev/sdXX
Mount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)
$ mount /home
Re-Create home folders for existing users.
$ cp -r /etc/skel /home/username
$ chown -R username:usergroup /home/username
That’s it.
add a comment |
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –
Unmount the /home folder
$ umount /home
Reformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)
$ mkfs.ext4 -F /dev/sdXX
Mount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)
$ mount /home
Re-Create home folders for existing users.
$ cp -r /etc/skel /home/username
$ chown -R username:usergroup /home/username
That’s it.
add a comment |
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –
Unmount the /home folder
$ umount /home
Reformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)
$ mkfs.ext4 -F /dev/sdXX
Mount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)
$ mount /home
Re-Create home folders for existing users.
$ cp -r /etc/skel /home/username
$ chown -R username:usergroup /home/username
That’s it.
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –
Unmount the /home folder
$ umount /home
Reformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)
$ mkfs.ext4 -F /dev/sdXX
Mount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)
$ mount /home
Re-Create home folders for existing users.
$ cp -r /etc/skel /home/username
$ chown -R username:usergroup /home/username
That’s it.
edited Jan 14 at 10:05
answered Jan 14 at 9:20
Simon SudlerSimon Sudler
1,483314
1,483314
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1109558%2freformat-only-the-home-partition%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
Seems like an XY problem. It is not clear why you would want to do that. Presumably you have another problem, and you think it can be solved by reformatting. That is not necessarily the best solution. Reformatting your home without technical precautions will break your installation.
– vanadium
Jan 14 at 8:48
1
why would you need to format /home? If you want to get rid of a user, delete the user. If you want to reset a user delete anything in /home/$USER of $USER (home will be recreated on the next login). I do not see any reason on why you would need to format /home and not /? I can understand formatting / and not /home but not the other way
– Rinzwind
Jan 14 at 10:08