I have the / partition and a home partition for the users. I always like it because I don't need to copy all the users files again after reinstalling.

Today I reinstalled Debian 8 Jessie on my computer but the installer didn't ask me if I had a previous home partition.

I found that my old home partition is mounted in /media/roby/0a2a038c-6525-4db4-9404-4b6a6cc31318 (the users folders are inside that folder with rare numbers).

I would like to have all the users in /home without moving files.

Here is the output of mount:

roby@roby-laptop:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=1427783,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=2287848k,mode=755)
/dev/sda8 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1143924k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sda10 on /media/roby/0a2a038c-6525-4db4-9404-4b6a6cc31318 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)

And this is the content of the /etc/fstab:

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda8 during installation
UUID=0d993ab9-95c8-467c-a29e-7faf55edbf0c /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda9 during installation
UUID=c333a585-606f-4299-a51a-491a873f2024 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

This is the output of fdisk -l:

roby@roby-laptop:~$ sudo fdisk -l

Disco /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectores
Unidades: sectores de 1 * 512 = 512 bytes
Tamaño de sector (lógico/físico): 512 bytes / 512 bytes
Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes
Tipo de etiqueta de disco: gpt
Identificador del disco: 7BFA0BD1-AAD9-44BC-9E39-02C19702ABA0

Device          Start        End    Sectors   Size Type
/dev/sda1        2048    1026047    1024000   500M EFI System
/dev/sda2     1026048    1107967      81920    40M desconocido
/dev/sda3     1107968    1370111     262144   128M Microsoft reserved
/dev/sda4     1370112    2906111    1536000   750M Windows recovery environment
/dev/sda5     2906112  318377983  315471872 150,4G Microsoft basic data
/dev/sda6  1936297984 1953523119   17225136   8,2G Windows recovery environment
/dev/sda7   318377984  318380031       2048     1M BIOS boot
/dev/sda8   318380032  384786431   66406400  31,7G Linux filesystem
/dev/sda9   384786432  408223743   23437312  11,2G Linux swap
/dev/sda10  408223744 1936297983 1528074240 728,7G Microsoft basic data

Las entradas de la tabla de particiones no están en el orden del disco.

This is the output of blkid:

roby@roby-laptop:~$ sudo blkid
/dev/sda1: LABEL="ESP" UUID="0C2C-B5E9" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="24239fe3-8042-42d8-99df-d806b3b4807a"
/dev/sda2: LABEL="DIAGS" UUID="ACCB-CD97" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="2ebf1341-b877-450d-9e40-3e3501e94c09"
/dev/sda4: LABEL="WINRETOOLS" UUID="082ECDC32ECDA9D0" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="3a25a975-26a8-49be-baba-dd7f8a954ddd"
/dev/sda5: LABEL="OS" UUID="F84AD3034AD2BD96" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="ca58cbd5-6ee8-49f4-8621-7481a3139e7e"
/dev/sda6: LABEL="PBR Image" UUID="26FE2ACEFE2A95D9" TYPE="ntfs" PARTLABEL="Microsoft recovery partition" PARTUUID="9b0eb66c-9325-47b3-9b6f-7ff65fad6201"
/dev/sda8: LABEL="raiz" UUID="0d993ab9-95c8-467c-a29e-7faf55edbf0c" TYPE="ext4" PARTUUID="463ac6e5-03c6-40c5-b3a6-8f6e7273d17c"
/dev/sda9: UUID="c333a585-606f-4299-a51a-491a873f2024" TYPE="swap" PARTLABEL="particion_swap" PARTUUID="91fbb9a7-4ca9-4f7c-aa4e-4cc8e7ca28b6"
/dev/sda10: UUID="0a2a038c-6525-4db4-9404-4b6a6cc31318" TYPE="ext4" PARTLABEL="particion_home" PARTUUID="737accdd-913a-4c71-bb54-403473f3f1a9"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="cff2cf6d-6d50-483b-a270-b67c6cfa366a"
/dev/sda7: PARTUUID="1df154d8-dfa5-4c08-ad79-0115d84a45cd"
  • Could you edit your question and add the output of mount? Apr 14 '17 at 14:25
  • Ah okay, so the new installation currently has no mount point set for /home. I will update my answer.
    – Alxs
    Apr 14 '17 at 15:14

Make sure to backup all your important files before running the commands bellow

Users on your new box need to have the same UIDs as your old box otherwise you need to run chown on every directory to fix this

  1. First you need to find the UUID of your old home partition

sudo blkid

Running blkid will give some thing like this:

/dev/sdc1: UUID="5cb14ab6-9e40-4a11-b0c5-02941e4c31dd" TYPE="swap" PARTUUID="972688be-01"
/dev/sda1: UUID="c9717f86-3774-4135-9b81-14b7559f5944" TYPE="ext3" PARTUUID="6bb0af62-01"
/dev/sdb1: UUID="5ac8e363-a519-4482-989d-12b2df7156b7" TYPE="ext3" PARTUUID="b416bc44-01"
  1. Identify the UUID that matches your old home partition according to you outputs it is "/dev/sda10"

  2. Add the following line at the end of your /etc/fstab

UUID=0a2a038c-6525-4db4-9404-4b6a6cc31318 /home ext4 defaults 0 2

  1. Reboot

your current /home will not be available after reboot please backup any important files there before reboot

  1. To rollback in case of failure remove the line added to fstab and reboot

You need to edit your /etc/fstab file in your preferred text editor. Use nano if you don't like vi/m.

$ sudo vim /etc/fstab

Locate the line containing /home in the second field and replace the current UUID with the UUID from your previous /home partition. Then:

$ sudo mount -a

to remount partitions from your fstab configuration. That should do, but post if you get any error output when running the mount command.


The updated question shows the home file system on your new installation doesn't have a separate mount point for /home. To create one at the location of your pre-existing /home directory, add the following to your /etc/fstab:

UUID=0a2a038c-6525-4db4-9404-4b6a6cc31318    /home    ext4    defaults    0 2

and then run mount -a again. If the mount command doesn't return any errors you should reboot your system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.