Move Your Home Directory To A Second Drive

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 192

  • @jeffreymerrick4297
    @jeffreymerrick4297 4 года назад +133

    Rather than removing everything under /home ("sudo rm -rf /home/*"), it is much safer to rename the home directory ("sudo mv /home /home~") and then create a separate empty home directory for the mount point ("sudo mkdir /home"). This way, all your data is still under /home~/username. After you've tested everything including automounting the new home directory on the second drive, then you can delete /home~ if you wish.

    • @loopdeloop8943
      @loopdeloop8943 4 года назад +16

      Jeffrey Merrick while doing this your tip helped me a lot. if i werent to do this i had lost my home folder lol. i renamed mine to homey xd

    • @viego29
      @viego29 2 года назад +11

      Well, I lost everything lmao.. should've checked the comments sooner

    • @rizkyadiyanto7922
      @rizkyadiyanto7922 2 года назад +4

      @@viego29 well, first thing before messing with your system is always BACKUP. cant go wrong with that.

    • @andrewvirtue5048
      @andrewvirtue5048 2 года назад +1

      Okay so following linear left towards right logic, you are saying:
      type "sudo mv /home /home~" which will move /home to the NEW drive "/home~" then typing "sudo mkdir /home~" will make the new drive file the new directory.

    • @quanq_quanq7560
      @quanq_quanq7560 Год назад

      Thanks for helping me wipe all my data 11:38

  • @viego29
    @viego29 2 года назад +4

    Followed the steps, now nothing in my Linux is working, can't open anything, can't click on anything, brother wtf, everything was fine until the deleting process, followed the command, and boom

  • @matthewwilson4978
    @matthewwilson4978 2 года назад +9

    @6:49 - just in case anyone is wondering rsync -x option means 'don't cross filesystem boundaries', so if you happen to have a soft link (or hard link?) file that links to a file on another mount point do not copy those files (on that difference mount point)

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 4 года назад +14

    For some years now it has been my practice to have the OS install in its own partition, even with only one drive. Allocate one partition of, say, 50GB for the OS, and a second one of the same size, initially left unused. All the rest is for /home. On today’s multi-terabyte drives, this is no big deal.
    What’s the second OS-sized partition for, you may ask? That’s if you want to try out another distro without wiping out your original OS install. You can point its /home directory at the same one used by the first install, and have all your user files immediately available under the new OS without having to copy them back and forth.

  •  4 года назад +7

    I just want to echo what DT pointed out earlier: if it is the /home directory you're moving (or any other directory where config files are kept), it's a good idea to do the entire process in tty, because you can potentially break your system (nothing unfixable, but still, why worry about that). If it is only music or videos or things like that, then it's fine to do it in the GUI. If you don't already know how to edit a text file in tty, learn that first. You can use nano, vim, or even ed, the standard text editor (depending on whether you're a noob, pro, or hacker, respectively).
    Also, if this is the first time you're doing this, have your /home directory backed up to an external drive, just in case you delete it before actually copying it. That would really be a shame :D
    In fact, it's a good idea to have your /home directory backed up on an external (unplugged) drive anyway, just in case of a hardware failure or something like that. But that's just common sense.

  • @BlueSniperF18
    @BlueSniperF18 4 года назад +22

    I was just about to do this for myself then you post the video! What fortunate timing

  • @VidarrKerr
    @VidarrKerr 3 года назад +4

    I still can't believe a faster way hasn't been created yet. Try doing this to twenty+ separate machines. Even Win10 is better at this.

  • @ogre14t1979
    @ogre14t1979 2 года назад +4

    I would love to see a video of installing a new OS while keeping the /home directory.

  • @tsilb
    @tsilb Месяц назад

    followed instructions
    went into TTY, rmed my /home/, had to add a -R as it was not empty :)
    went to switch back to plasma session
    made me log in
    i'd log in and it'd blink and go right back to the login prompt
    fortunately I remembered /etc/fstab - and it had a comment in it that reminded me the command to get the UUID.
    Muddled my way through executing the command *from within nano* so I could mark, copy, paste with Nano's horrible default keybindings (I have no /home, so I have no .nanorc)
    So just from my hairbrained memory, I was able to get my new /home/ filled in on the fstab file.
    Rebooted and viola!
    The login loop would've made me super nervous if it hadn't been a fresh install. Just wasn't patient enough to wait for the new drive to arrive before installing :)
    Thanks, and as always, keep being awesome!

  • @LloydLynx
    @LloydLynx 4 года назад +8

    My old installation used to be symlinked together, I had manually symlinked about half the folders within /home to another drive. It was such a pain when they broke.

    • @Your_Degenerate
      @Your_Degenerate 4 года назад +1

      I've been doing that with a single link to a directory on my 2nd drive. The only annoyance is navigating to it when saving/opening files.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 4 года назад

      I currently have files spread across 3 drives on my main machine. I used to use symlinks to tie it altogether, but this got a little bit irritating when moving around the directory tree caused relative links to misbehave. So lately I have decided to try bind mounts instead.

  • @morozovsergey4279
    @morozovsergey4279 4 года назад +3

    Derek, thanks a lot for such an informative video! Logically, the next one should be about how to configure the fstab file, when different drives (SSD, HHD) are available... e.g. a SSD for the system, and a couple of HDDs for data storage... Once again, minor features and nuancies you describe so well matter!

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 4 года назад +13

    Thank you, Derek. ~ is bloat. Seriously, good and clear presentation.

  • @Alex-ur3vt
    @Alex-ur3vt 2 года назад +2

    You don't understand how much this helped

  • @MichaelJHathaway
    @MichaelJHathaway 4 года назад +3

    ** Thanks Derek!!, this makes switching from Arch back to Ubuntu so much easier! (lol) Gparted is ok, I like KDE Partition Manager better. Love your new pop filter, I was going to suggest the BSW, which is small and clean. You can put it a lot closer to the mic too.

  • @healek9273
    @healek9273 4 года назад +2

    I prefer using a dedicated partition/drive for data files, HOME is mostly for transitory and local packages files. HOME is usually a big source of issues between distros and BSD family!

  • @sleepyeyesvince
    @sleepyeyesvince 4 года назад +2

    I approve of more DT tutorials :D Nicely explained dude.

  • @TakeTurnsGaming
    @TakeTurnsGaming 4 года назад +1

    in my opinon man, I feel like there is a surge of new linux people trying to rice their WM/DE and what not. what do you think about doing in depth tutorials on config customization explaining why you do what you do in your dotfiles, and throwing them up on your main site maybe even monetize them behind patroen . just a suggestion, keep doing the good the work!

  • @daveprice9128
    @daveprice9128 2 года назад +2

    I was wondering if you could put /boot efi, /root on one disk (sda) ------- /home on other disk (sdb)…I won't be using a swap partition, I'll be making a swap file. This would be at install.
    I will be using 2 NVMe drives. I used SATA drives in this example but it's still the same.

  • @sujayr6983
    @sujayr6983 3 года назад +1

    thank you dt. I'm a noob and you made such a complex operation so easy to understand. i'll definitely support you on patreon once i'm employed.

    • @Goobyster
      @Goobyster 2 года назад

      hows the employment thing going

  • @ammardayoub2349
    @ammardayoub2349 4 года назад +3

    Wow, perfect execution of a tutorial video Derek!

  • @BrucesWorldofStuff
    @BrucesWorldofStuff 4 года назад +2

    Wow! I just did this same thing but just for my /Video folder. Two days ago.... I added a 1tb HDD to the system and it is mounted to my /home/Videos folder... It has the hold drive just for movies.... :-D
    Now when I reinstall I'll just tell it NOT to format that drive on installation and use that drive for my /Videos folder...
    Thanks DT
    LLAP

  • @shredwerd009
    @shredwerd009 2 года назад +1

    Thanks - I screwed up my / and made it 10gb instead of 100gb originally, so i redid everything but figured i could be sneaky and keep my /home on the larger partition, but instead it created a new one on root (/). so i essentially wiped the old partition and followed this, along with Jeffrey's comment for safety on keeping /home~ in case of mistakes. nice.

  • @Vintage_USA_Tech
    @Vintage_USA_Tech 14 дней назад

    @DistorTube I would like to thank you for this information.... I would just like to bring it to your attention that the link to this blog article is broken.... I had no problem finding the information on your website but thought you might want to know.... Great information thanks.

  • @GeneralHazerd
    @GeneralHazerd 4 года назад +1

    As always: thanks for the great, informative, easy to follow content. :) But: WHERE WERE YOU WHEN I NEEDED TO DO THIS, MAN???? Haha I did this a while back, though
    I would have preferred to learn how from you :)

  • @infodiff
    @infodiff 3 года назад +1

    i am gettin glogged out after the reboot ( after making all the changes )
    tried 5-6 times watching the video and then ur written instructions on the blog also.

  • @user-gt8ql9vp1b
    @user-gt8ql9vp1b 4 года назад

    Didn't know that move is such a revelation. I'm using a separate drive for the homedir for years on my laptop. On my desktop the homedir sits on a separate partition, which I unmount when upgrading, etc.

  • @steveschwartz2571
    @steveschwartz2571 4 года назад +2

    Thanks DT, just what I was looking for!

  • @tusharkuntawar6170
    @tusharkuntawar6170 4 года назад +2

    I did not know I needed this up until I saw this. 🤟🤟

  • @matthewwilson4978
    @matthewwilson4978 2 года назад

    @12:36 - output with less clutter (we don't really need to see cgroup on entries) is: df -lh

  • @samuelitooooo
    @samuelitooooo 11 месяцев назад

    I've already got my home directory on another drive where I want it, so I'm here for the part where it's permanently mounted. Thank you!
    Question: Are these instructions also for if your home directory is [to be] on the same disk but different partition?

  • @serge5046
    @serge5046 4 года назад +1

    Removing the home folder was not a good idea: you don't have a backup of your data in the home folder at least in the VM. It would have been better to have a well thought partitioning scheme before installing the system. Now if you didn't put your /home on a separate drive during the installation then it would be better to copy the data from the huge subfolders under /home/dt to that separate drive and create a symlink between these subfolders (for instance ln -s /mnt/tmp/Music /home/dt/Music).
    You still need to have a backup of these data. Look also at the comment of Myszka!
    Cheers

  • @matthewwilson4978
    @matthewwilson4978 2 года назад

    @11:31 - fstab file the '0' is for 'used by dump tool, 0 meaning don’t dump if filesystem is not present.' and the '2' = used by fsck tool for discovering filesystem check order, this value means check this device after root filesystem.'. source: search online for 'How to Move Home Directory to New Partition or Disk in Linux' and check out the techmint article. RUclips dosen't seem to like us posting links

  • @yassinenacif418
    @yassinenacif418 3 года назад +1

    But I want to migrate the hole OS to another disk drive, how is that done?

  • @copper4eva
    @copper4eva 4 года назад +1

    I've only installed Linux on laptops with single drives so far, my main desktop is still windows. This will be very useful when I finally get around to going full Linux. Plus my main laptop can get a M.2 ssd put in it, which I plan on doing, making it a two hard drive machine.

  • @MuhammadSaad-bf8ue
    @MuhammadSaad-bf8ue 4 года назад

    Thanks dt! Worked smoothly. I just move my entire home directory to an HDD and expanded root to cover the entire SSD

  • @9bnmadden
    @9bnmadden 2 года назад

    Hey DT! Great video. It looks like your blog link is broken. Do you have an updated location for this post?

  • @jim7smith
    @jim7smith 6 месяцев назад +1

    I know this is old video, dt.........The only thing missing is the procedure for actually doing a recovery if your boot drive fails. Secondly. your link for the blog post is not showing up because you restructured the site and instead of blog, the link is articles. You might want to edit these notes on the video. Just sayin...

  • @urugulu1656
    @urugulu1656 4 года назад +1

    id take ntfs for the seperate drive since then i can also use that same drive on a windows installation if i really want to (dual boot systems come to mind)
    also it could be a good idea to move your syslogs and that kinda stuff somewhere seperate just so that if anything fails you can easily go through them and investigate

  • @bitsurface5654
    @bitsurface5654 4 года назад

    Cool Stuff DT, I am on the way to my LPIC 1,2,3 Exam. Maybe in about 8 month I will finish this and can get a job in this area? Then, I will contribute to your account. I like your Stuff !!!

  • @jeffreyplum5259
    @jeffreyplum5259 5 месяцев назад

    I am getting into using raspberry pis. If you boot from an SD card or flash drive, your boot drive will have very limited space.. Pi OSes also tend to assume they boot on a single drive system.
    Mounting and additional flash drive can double your storage space. You can also clone that carefully crafted boot device or your data drive. Flash media, SD cards or flash drives have limited write cycle. I have lost data relying on an SD card without proper backups. It was my own writing,. I type very slowly, so that was days of work lost. Please be careful.

  • @Lightcode777
    @Lightcode777 2 года назад +1

    awesome worked perfectly. and very useful thanks DT !

  • @lv99redchocobo37
    @lv99redchocobo37 3 года назад

    this was tough to follow for a newbie like me, but i managed to follow along with a couple extra google look-ups on how to do this or that

  • @Onesmo
    @Onesmo 3 года назад

    You're doing the lord's work. Thank you.

  • @Khyree_Holmes
    @Khyree_Holmes 4 года назад +4

    I have a Linux Juke Box PC! My Music is copied across my Linux rigs: Laptop and Main PC.
    12:00 - I have found Nemo!

  • @costascostas1760
    @costascostas1760 4 года назад

    I have been doing this on Windows too with each directory for downloads music documents etc. Even for my email profile. Never tried the home folder completely because I could never tell how much space I need and also so that reinstalling will delete all my configs to start fresh. I am diatrohopping with the same distro for a while now. Just moved to kubuntu and looks awesome.

  • @charlessilberman1097
    @charlessilberman1097 3 года назад +1

    It was a great video
    The link to the blog post does not work

  • @revsoldest7426
    @revsoldest7426 Месяц назад

    I probably have a dumb question but I have not found the answer online. I have a ssd that 250gb and a hdd that is 20tb the ssd has / and my hdd has my /home on it. If I decided to change distros I'm on (Arch base sys) can I switch to a Debian or a Redhat base linux with out without messing up the app or data that on my home directory ? (I know I can go from Arch to Arch base sys )

  • @obbavyakti5805
    @obbavyakti5805 3 года назад +1

    You could also just create a separate partition for /home

  • @bogdanlupu3679
    @bogdanlupu3679 Год назад

    It would be a nice to have a tutorial in which you install a different distro keeping the same home or multiple distros with the same /home. (Ubuntu and Arco). Is not so scary as it seems and when a linux user start distro hopping is a useful knowledge.

  • @Duckeezilla
    @Duckeezilla 2 года назад

    Hi, Derek, thanks for your tutorials! I don't know if you know, but your blog appears to be down

  • @marktahu2932
    @marktahu2932 3 года назад

    Thanks so much - Clear & Concise! Couldn't ask for a better tutorial.

  • @stealthastentar6716
    @stealthastentar6716 4 месяца назад +1

    LEGEND

  • @fuseteam
    @fuseteam 4 года назад

    what about backing up applications? would mounting /usr and /etc be enough? would that break something?

  • @phineas7767
    @phineas7767 2 года назад

    9:39 let me back into the Lock Screen but every time I enter my password the screen goes black and puts me back into the Lock Screen. I’ve tried rebooting through the tty but nothing happens. Please help.

  • @Xeab
    @Xeab 4 года назад +1

    Could you not use a live cd with chroot if you really wanted to be safe

  • @CG-sv2nw
    @CG-sv2nw 3 года назад

    If I move the home folder does it not move the music folder and all that to the second drive?

  • @JessVdH
    @JessVdH 3 года назад +1

    You explained it really well, thanks a lot!

  • @WhatIsItReallyAbout
    @WhatIsItReallyAbout 4 года назад +1

    Very useful. Thanks for posting

  • @ahmedal-modaifea4457
    @ahmedal-modaifea4457 Год назад

    I know it's an old video by now, but shouldn't you include solutions for possible issues that you mentioned?

  • @KostasKolias
    @KostasKolias 4 года назад +1

    DT are you prof. Menser? Very similar voice if not.

  • @yomajo
    @yomajo 11 месяцев назад

    11:20 - it doesn't matter how many spaces between the fields?

  • @lolnjeoglondajmejejplejlis3365
    @lolnjeoglondajmejejplejlis3365 2 года назад

    100GB of music?
    you sure?
    800 songs take up like 300MB
    im confused

  • @BrenoSilveira94
    @BrenoSilveira94 4 года назад +3

    Can you add this to the Arch wiki? That would be awesome.

    • @MisterBrausepulver
      @MisterBrausepulver 4 года назад

      This stuff is included in the installation guide for quite a while

  • @rajtiwari665
    @rajtiwari665 3 года назад

    Thanks a lot for this simple and crisp tutorial

  • @sarafenua
    @sarafenua Год назад +1

    Thank you. It worked 😊

  • @rikvanblyat6028
    @rikvanblyat6028 2 года назад +1

    Awesome! Thank you! 💯

  • @_antoniocouto
    @_antoniocouto 4 года назад

    Quick question: Where do you mount a second drive? /mnt/seconddrive, /media/seconddrive, /home/seconddrive,..?

  • @geirha75
    @geirha75 3 месяца назад

    by the way... there is no need for chmod? How did he get tty promt?

  • @noah5592
    @noah5592 2 года назад

    Could you do this similar thing by making a new partition on the same drive as the OS for your /home directory?

  • @davb001
    @davb001 3 месяца назад

    Would this process be the same on Mint Cinnamon 21.3 distro? Thanks!

  • @matthewmoore757
    @matthewmoore757 Год назад

    I always split my root and home directories over two drives. Problem is, my root directory is on an SSD, and my /Home directory isn't. So it gets a little slower when i do that. But with the video editing and other data that i'm always moving around, it's a compromise that i need to take. As i'm saving read/writes against my SSD. Oh well.

  • @sanjaysinha4205
    @sanjaysinha4205 4 года назад

    hie... I am using CentOs 6.10... followed the steps to move home directory.. and i could do succesfully....but there is an issue...
    result for df -Th is given below... which is fine:
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/sda1 ext4 33G 4.3G 27G 14% /
    tmpfs tmpfs 763M 220K 763M 1% /dev/shm
    /dev/sda3 ext4 40G 29G 9.3G 76% /home
    but when I check on disk usage analyzer... the root is showing 100% filled... which means its eating up space for earlier /home...
    please help me out...
    PS: I am a newbie to linux...

  • @marioschroers7318
    @marioschroers7318 4 года назад

    Been thinking about testing this. I use a separate home partition (one hard drive in my computer), but I never tested installing Linux mounting an existing home partition. Should test it out.

  • @urugulu1656
    @urugulu1656 4 года назад

    mmmh mounting somewhere like ~/ is actually not that dumb i always went with moving everything over and creating a symbolic link ... depending on how crazy you go with this you may encounter some trouble though. i have done such stuff for some logfile paths and when you detach the drive the system did not want to finish booting until the drive was present again. so know what your in for

  • @abhishek7398
    @abhishek7398 4 года назад

    Can I move /usr directory the same way? I m trying hard to find something instead everything is confusing and system is also crashing as I rsync -a usr? Can u suggest something

  • @MyszkaAgresorka
    @MyszkaAgresorka 4 года назад +2

    7:06 - /dev/sdb1 is already mounted in /mnt/tmp ( 6:17 ) and what you see in Nemo is different mount point: /media/$USER/$UUID (look in Nemo title bar...)

    • @a_maxed_out_handle_of_30_chars
      @a_maxed_out_handle_of_30_chars 4 года назад

      I was wondering the same

    • @ralesarcevic
      @ralesarcevic 4 года назад

      fair enough, but you can mount drives wherever you want infinitely many times too, so it doesn't really matter what was the mountpoint that nemo found when it's the same drive

  • @chukwudiemmanuel9186
    @chukwudiemmanuel9186 2 года назад

    Hello man. I have two drives on my computer. I installed playonlinux on my Linux mint which is currently saved in my home directory as '''PlayonLinux virtual drives" folder on one of my drives where my OS is running. It really took a lot of space. How can I move this folder from my home directory where it is currently stored to the other drive on my computer and create a symbolic link so that my computer thinks it is still in its location. I really need this space and I would appreciate it if you make a video on this. Thanks man.

  • @fuseteam
    @fuseteam 4 года назад +1

    btw do you use middle click paste aka primary selection?

    • @DistroTube
      @DistroTube  4 года назад +1

      Most of the time I just use middle click for copy/paste. In alacritty, I also have Shift + CTRL + c/v to copy/paste.

    • @fuseteam
      @fuseteam 4 года назад

      @@DistroTube i mean that the shortcut in gnome terminal too but i generally find primary paste easier

  • @utubepunk
    @utubepunk 2 года назад

    What if I wanted to encrypt the separate drive?

  • @daveprice9128
    @daveprice9128 Год назад

    Can you specify all this when you partition the drive at install

  • @Niko0902
    @Niko0902 3 года назад

    Absolutely great!

  • @VulcanOnWheels
    @VulcanOnWheels 2 года назад

    I thought I had moved my /home to a second partition, but I later found out that I hadn't. I'm trying to correct that now.

  • @spaceguybob
    @spaceguybob 2 года назад

    Now how would I be able to use this home directory with another distro of Linux? Or maybe even wsl?

  • @frecio231
    @frecio231 3 года назад

    it is a good idea to still backup your data in another external drive, just in case

  • @timh.7341
    @timh.7341 3 года назад

    What if your home directory is encrypted?

  • @cbbcbb6803
    @cbbcbb6803 Год назад

    How to reinstall linux without overwriting the separate home directory?

  • @SteveStowell
    @SteveStowell 8 месяцев назад

    You still have to backup

  • @rantceck
    @rantceck 3 года назад

    I have a linux/windows dualboot, and I have all my personal files in a separate partition, but when I tried to setup spotify local files the media folder doesn't appear. The same happens with JDownloader if I want to download something automatically to that partition. (is this because linux can't use other partitions like windows does?) *INSERT SORRY FOR MY ENGLISH* xD

  • @DocKingliveshere
    @DocKingliveshere 2 года назад

    Not Found
    The requested URL was not found on this server.

  • @tsundokuboi1820
    @tsundokuboi1820 4 года назад

    Why not use the genfstab command instead of doing it manually?

  • @diabissam2368
    @diabissam2368 3 года назад

    what is the difference between vi and vim???

  • @vanadium4167
    @vanadium4167 4 года назад

    You *don't* have a backup already when your data is on another drive :(

  • @agenttank
    @agenttank 4 года назад

    moving files is not a backup...

  • @philippeheyvaert3742
    @philippeheyvaert3742 3 года назад

    Can someone create a seperate virtual disk in VirtualBox and use it for various different Linux operating systems? It seems like a handy option if there are a lot of config files. I myself do all my testing in VirtualBox. I'm running Debian and Arch right now. But I'm experimenting with XMonad and Openbox on both. If I create a new installation of let's say Debian with a seperate virtual disk for the home folder. Can I use that virtual disk for another distirbution and add it after the installation of that operating system? Nice video (as always). Greetings from Belgium.

  • @nopik4669
    @nopik4669 3 года назад

    Thanks, DT :)

  • @BPAvt
    @BPAvt 2 года назад

    this was so helpful. thank you.

  • @joelmativet3647
    @joelmativet3647 4 года назад +1

    I have a 64Gb SSD for root and a 250Gb SSD for home and a 4To SSHD for stock and have had that setup for years..!!

    • @_DT_
      @_DT_ 4 года назад

      That is a lot of GiB dedicated to /

    • @joelmativet3647
      @joelmativet3647 4 года назад

      @@_DT_ When I bought the drive, there was only a $3 difference between a 32Gb and a 64Gb, so I got the 64Gb..

  • @LazyLoneLion
    @LazyLoneLion 2 года назад

    The link gives "SSL protocol error"

  • @loca8522
    @loca8522 3 года назад

    how do i get into a tty prompt?

  • @terranscope
    @terranscope Год назад

    Thank you