Reformat only the home partition












1















I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?










share|improve this question























  • 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
















1















I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?










share|improve this question























  • 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














1












1








1








I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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










1 Answer
1






active

oldest

votes


















0














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/fstab and run lsblk)



    $ mkfs.ext4 -F /dev/sdXX



  • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)



    $ mount /home



  • Re-Create home folders for existing users.



    $ cp -r /etc/skel /home/username
    $ chown -R username:usergroup /home/username



That’s it.






share|improve this answer

























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    0














    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/fstab and run lsblk)



      $ mkfs.ext4 -F /dev/sdXX



    • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)



      $ mount /home



    • Re-Create home folders for existing users.



      $ cp -r /etc/skel /home/username
      $ chown -R username:usergroup /home/username



    That’s it.






    share|improve this answer






























      0














      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/fstab and run lsblk)



        $ mkfs.ext4 -F /dev/sdXX



      • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)



        $ mount /home



      • Re-Create home folders for existing users.



        $ cp -r /etc/skel /home/username
        $ chown -R username:usergroup /home/username



      That’s it.






      share|improve this answer




























        0












        0








        0







        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/fstab and run lsblk)



          $ mkfs.ext4 -F /dev/sdXX



        • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)



          $ mount /home



        • Re-Create home folders for existing users.



          $ cp -r /etc/skel /home/username
          $ chown -R username:usergroup /home/username



        That’s it.






        share|improve this answer















        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/fstab and run lsblk)



          $ mkfs.ext4 -F /dev/sdXX



        • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)



          $ mount /home



        • Re-Create home folders for existing users.



          $ cp -r /etc/skel /home/username
          $ chown -R username:usergroup /home/username



        That’s it.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 14 at 10:05

























        answered Jan 14 at 9:20









        Simon SudlerSimon Sudler

        1,483314




        1,483314






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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 send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?