Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
23
votes
5
answers
141946
views
Invalid cross-device link while Hardlinking in the same file system
I have **/home/myuser/Desktop/rc/.netrc** file that i want hardlink to **/root**, ie home directory of **root** user. When i do: `ln /home/user/Destkop/rc/.netrc /root` it gives the following error: > ln: creating hard link `/root/.netrc' => `.netrc': Invalid > cross-device link but it works when i...
I have **/home/myuser/Desktop/rc/.netrc** file that i want hardlink to **/root**, ie home directory of **root** user.
When i do:
ln /home/user/Destkop/rc/.netrc /root
it gives the following error:
> ln: creating hard link /root/.netrc' =>
.netrc': Invalid
> cross-device link
but it works when i hardlink the file to **myuser**'s home, ie to **/home/myuser**.
So, what's the problem, why it says invalid cross-devices when there is only one file system here?
**PS.** I am using **RHEL6**
Elvin Aslanov
(387 rep)
Jun 12, 2013, 09:48 AM
• Last activity: Jul 19, 2025, 11:33 AM
4
votes
1
answers
5177
views
BTRFS: Adding new hard drive as /home after installation
My SSD is only 110 GB in size, so moving the old /home (btrfs) to a new /home (also btrfs) on a bigger HDD is likely a good idea. Is it possible to combine btrfs-subvolumes as separate subvolumes on separate partitions (even on separate devices) but as children of the top level subvolume (ID 5)????...
My SSD is only 110 GB in size, so moving the old /home (btrfs) to a new /home (also btrfs) on a bigger HDD is likely a good idea.
Is it possible to combine btrfs-subvolumes as separate subvolumes on separate partitions (even on separate devices) but as children of the top level subvolume (ID 5)????
Does this procedure enable snapshots of the new /home?
This is my current entry for the old /home on SSD in fstab:
UUID=23cef669-f46c-4f5b-8476-ba548256e754 /home btrfs rw,noatime,compress=lzo,ssd,space_cache,subvolid=258,subvol=/@home,subvol=@home 0 0
As far as i know the procedure to move /home is as follows:
>a) create a mountpoint for the new /home (e.g. /mnt/home)
>b) adjusting fstab entry of /home: UUID> mountpoint> btrfs> mountoptions
>c) copy all files from old to new /home via life system
(e.g. cp -ar /oldhome/* /newhome)
But i'm not sure what to do with mount options: can i use the old subvolume options?:
subvolid=258,subvol=/@home,subvol=@home
Should be harmless as long as the old entry is going to be deleted?!
If yes, the new fstab entry on HDD for /home would look like this:
UUID=7ad83a78-4e19-45df-9c6e-1d931a9f999c /mnt/home btrfs noatime,compress=lzo,subvolid=258,subvol=/@home,subvol=@home 0 2
What did i forget? Any comments, hints or suggestions for improvement?
kinoe
(41 rep)
Jun 13, 2017, 05:19 PM
• Last activity: Jun 27, 2025, 01:03 PM
0
votes
0
answers
70
views
best way to have multiple homes?
I have a number of drives on a given machine with different disk configuration. - root drive. - 2 disk mirror. - zfs array. To accommodate a variety of failure scenarios, I want user homes to be: - zfs when it's up and working. `/mypool/mydataset/home/username` - mirror if zfs is down but mdadm is w...
I have a number of drives on a given machine with different disk configuration.
- root drive.
- 2 disk mirror.
- zfs array.
To accommodate a variety of failure scenarios, I want user homes to be:
- zfs when it's up and working.
/mypool/mydataset/home/username
- mirror if zfs is down but mdadm is working. /mymirror/home/username
- root drive if there's something wrong with both zfs and mdadm. /home/username
Files will need to be synced across all 3.
What's the best way to achieve this?
Best in terms of reliability:
1. fault tolerant (works even when some software or hardware is broken - i.e. the more faults it will tolerate, the better. ideally will "just work" with cpu/ram/mb/boot drive working and everything else is broken, including nic, vga card, all other hdds, etc; while being transplantable to new cpu/ram/mb/boot drive to accommodate those failures)
2. tamper proof - users can't stuff it up to remove this "protection".
John
(109 rep)
Jun 20, 2025, 01:40 AM
• Last activity: Jun 20, 2025, 02:36 AM
0
votes
1
answers
96
views
Separate /home partition not auto-mounted despite correct fstab
Unable to log in via the display manager, and when I go to a TTY, I get the error `/home/user change directory failed no such file or directory`. My `home` partition is on a separate partition. When I go to `/home` in TTY, the directory is empty. It appears that the `home` partition isn't being auto...
Unable to log in via the display manager, and when I go to a TTY, I get the error
/home/user change directory failed no such file or directory
.
My home
partition is on a separate partition.
When I go to /home
in TTY, the directory is empty.
It appears that the home
partition isn't being automatically mounted.
Fstab:
UUID=aeb982de-cb3d-49bb-90d9-71620172191c / btrfs subvol=root,compress=zstd:1 0 0
UUID=d1205351-97c4-409d-9274-f6a26cdd5e75 /home ext4 defaults 1 2
UUID=61469ef5-023a-42d0-a451-3e0bf5ae4a54 none swap defaults 0 0
All UUIDs are correct in fstab
.
How can I correct the problem?
Chris Deacon
(1 rep)
May 18, 2025, 10:13 PM
• Last activity: May 19, 2025, 03:28 PM
1
votes
2
answers
122
views
How to move /home directory from HDD to SSD (without reinstalling Linux Mint)?
I'm a beginner to Linux and using **Linux Mint**. When I first installed Mint, I placed the **root `/` directory on my SSD**, and the **`/home` directory on a small partition of my HDD**. Now that I have more space available on the SSD, I’d **like to move `/home` to the SSD**, for better performance...
I'm a beginner to Linux and using **Linux Mint**.
When I first installed Mint, I placed the **root
/
directory on my SSD**, and the **/home
directory on a small partition of my HDD**. Now that I have more space available on the SSD, I’d **like to move /home
to the SSD**, for better performance and a fresh start.
I don't have any important data in my current /home, so I’m okay with starting fresh — but I don’t want to reinstall Mint, since I’ve already customized it perfectly for my needs.
I tried to follow a suggestion from ChatGPT that said to comment out the /home
entry in /etc/fstab
. But when I rebooted, I got stuck in a login screen loop. I had to go back and fix it manually.
Here’s a snippet from my current /etc/fstab
:
#
# / was on /dev/nvme0n1p5 during installation
UUID=4db22b84-da3c-4101-9bf5-e58e4ade3681 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=AEBC-B055 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda2 during installation
UUID=6397f416-fe69-4a90-9336-7497d42df184 /home ext4 defaults 0 2
# this was the HDD - DATA
UUID=1A863C6A863C4891 /media/data ntfs defaults 0 0
**Could someone kindly guide me:**
How to move /home
to the SSD and clean the /home
in the HDD?
Do I need to remove the /home
mount from fstab
or move/copy anything manually?
What are the exact steps, assuming I’m a beginner and want a smooth experience?
**More details:**
alexmatt@NodeX:~$ lsblk -o NAME,SIZE,FSTYPE,UUID,MOUNTPOINT,TYPE,MODEL
NAME SIZE FSTYPE UUID MOUNTPOINT TYPE MODEL
sda 931.5G disk ST100
├─sda1 881.5G ntfs 1A863C6A863C4891 /media/dat part
└─sda2 50G ext4 6397f416-fe69-4a90-9336-7497d42df184 /home part
nvme0n1 931.5G disk CT100
├─nvme0n1p1
│ 100M vfat AEBC-B055 /boot/efi part
├─nvme0n1p2
│ 16M part
├─nvme0n1p3
│ 680.8G ntfs E2D2BE88D2BE6089 part
├─nvme0n1p4
│ 650M ntfs 1454D66754D64ADE part
└─nvme0n1p5
250G ext4 4db22b84-da3c-4101-9bf5-e58e4ade3681 / part
alexmatt@NodeX:~$
*Thank you in advance for any clear explanation and help!*
Alex Matthew
(11 rep)
Apr 24, 2025, 01:12 AM
• Last activity: Apr 26, 2025, 09:01 PM
46
votes
2
answers
11193
views
Does ~ always equal $HOME
I know this has probably been asked before, but I couldn't find it with Google. Given * Linux Kernel * No configurations that change $HOME * bash Will `~ == $HOME` be true?
I know this has probably been asked before, but I couldn't find it with Google.
Given
* Linux Kernel
* No configurations that change $HOME
* bash
Will
~ == $HOME
be true?
PythonNut
(1464 rep)
Jul 26, 2014, 03:02 AM
• Last activity: Apr 19, 2025, 02:45 PM
0
votes
1
answers
67
views
Can I restore my home directory after freshly installing a new version of Fedora or should I first install the previous version and then upgrade
I have a backup from my home directory which was created under Fedora 40 (which was configured by my previous employer). Now I have a new SSD in my laptop on which I want to use Fedora 41 with the data (and ideally the configurations) of my old home directory. Overall, I know very little about Linux...
I have a backup from my home directory which was created under Fedora 40 (which was configured by my previous employer). Now I have a new SSD in my laptop on which I want to use Fedora 41 with the data (and ideally the configurations) of my old home directory.
Overall, I know very little about Linux and I am looking for a beginner-friendly answer.
Now, I see 2 options A and B:
A)
1. First, freshly install Fedora 40
2. restore my home directory from my backup
3. afterwards, upgrade to Fedora 41
Can the upgrade procedure automatically upgrade config files from my backup that were not compatible with Fedora 41?
Within version A), should I i) reinstall all my apps before 2. or ii) between 2. and 3. or iii) after 3.?
B)
1. Directly freshly install Fedora 41
2. restore my home directory from my backup
Is a completely fresh install of Fedora 41 more stable than upgrading from 40? Can config files from Fedora 40 in the home directory be incompatible with Fedora 41? Within version B), should I i) reinstall all my apps before 2. or ii) after 2.? Does installing an app overwrite its config files in the home directory?
Or is there a better option C?
Jakob
(119 rep)
Mar 15, 2025, 11:16 AM
• Last activity: Mar 15, 2025, 11:58 AM
1
votes
3
answers
3302
views
Mount NTFS partition as /home with fstab
I am currently installing Arch Linux on a machine which has Windows 10 already installed on it, and I want to use a NTFS partition as /home (because that way, I can easily access my Linux-files from within Windows). I've tried to install it this way two times by now, but both times it failed (it wou...
I am currently installing Arch Linux on a machine which has Windows 10 already installed on it, and I want to use a NTFS partition as /home (because that way, I can easily access my Linux-files from within Windows).
I've tried to install it this way two times by now, but both times it failed (it would boot in recovery mode, with logs saying that the ntfs-drive couldn't be read).
My question is now, what is the correct way to put this drive in
/etc/fstab
? I created the current fstab with genfstab -U -p /mnt >> /mnt/etc/fstab
and now I have the following entry for the ntfs-drive:
# /dev/sda2 LABEL=LinuxData
UUID=... /home ntfs-3g rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
I want every user on the system to be able to read, write and execute to /home.
Rien
(121 rep)
Jun 27, 2015, 01:07 PM
• Last activity: Mar 6, 2025, 08:06 PM
3
votes
1
answers
4804
views
Tiny Core Linux persistent home directory
I have a command line **frugal** install of Tiny Core and I want to have a **persistent home directory**, because the programs I run save results there. I read the [persistent option details][1] and followed [these instructions][2]. Already added the `home=UUID="xxxxxx"` boot option to the `/mnt/sda...
I have a command line **frugal** install of Tiny Core and I want to have a **persistent home directory**, because the programs I run save results there.
I read the persistent option details and followed these instructions .
Already added the
home=UUID="xxxxxx"
boot option to the /mnt/sda1/tce/boot/extlinux/extlinux.conf
file and saved it with filetool.sh -b
.
During the boot process the home=UUID
part is printed to the console, the extlinux.conf
file stays persistent, but when I create files in the home directory, they disappear after reboot.
Is there any way to make this work? If the system stops accidentally, will these permanent files remain there with the latest content, or the system saves them only on shutdown?
I also thought about creating a cronjob and execute backup script in every n minutes, but this is the last solution I would like to have.
Patartics Milán
(131 rep)
May 9, 2016, 10:46 AM
• Last activity: Feb 14, 2025, 07:46 PM
10
votes
5
answers
24357
views
Difference between “/export/home” and “/home”
In our UNIX machine my home path looks like `/home/ ` and we have another batch user whose home looks like `/export/home/ ` I want to know what's the difference between `/export/home/ ` and `/home/ `? Why there are difference in folders when both are some user in UNIX?
In our UNIX machine my home path looks like
/home/
and we have another batch user whose home looks like /export/home/
I want to know what's the difference between /export/home/
and /home/
?
Why there are difference in folders when both are some user in UNIX?
Vivek
(203 rep)
Apr 20, 2011, 10:11 AM
• Last activity: Jan 20, 2025, 09:39 PM
-1
votes
1
answers
79
views
Where should non-root-user programs write the data which system-level programs write to (subdirectories of) /var?
### Background Unix convention and the Linux Filesystem Hierarchy standard define several paths under which processes look for certain information, or use to write certain information. When one needs to setup a user-specific environment, as a non-root user - most of those locations are either inacce...
### Background
Unix convention and the Linux Filesystem Hierarchy standard define several paths under which processes look for certain information, or use to write certain information. When one needs to setup a user-specific environment, as a non-root user - most of those locations are either inaccessible, or readable but without the ability to write to files or create new ones. So, one must use alternatives.
In principle, we could just treat a user's home directory like another
/
; however, that's not common practice.
There is also the custom of creating a $HOME/.my_app
directory. Most apps which create those use those for configuration, but some also for other kinds of data (Eclipse, Firefox, Thunderbird come to mind as hiding gobs of data in there). But that means we may have dozens if not hundreds of .something
in the home directory, which is quite unseemly.
Finally, it has also become common for some apps to write into $HOME/.local
and $HOME/.config
, which does not "litter" the home directory itself: $HOME/.config
can be seen as an equivalent of /etc
and $HOME.local
of /usr
; so, quite useful, but - it doesn't cover /var
and its subdirectories.
### Actual question
Where, under a user's home directory, should we, or should a program we write, store the data which a system-level program would store in /var
, or subdirectories of /var
? That is to say: "files whose content is expected to continually change during normal operation of the system, such as logs [and] spool... files" (to quote the FHS), as well as cache, non-static databases, lock files, run files and log files?
einpoklum
(10753 rep)
Nov 14, 2024, 04:47 PM
• Last activity: Nov 14, 2024, 10:28 PM
-4
votes
1
answers
77
views
How to get to /home when I am in /Users
I am new to using Linux so I am not sure how to fix this problem. When I would use the pwd command it would show /Users/(my name). However, I need to get to the home directory and can't figure out a way to get to /home/(my name). Please help!
I am new to using Linux so I am not sure how to fix this problem.
When I would use the pwd command it would show /Users/(my name).
However, I need to get to the home directory and can't figure out a way to get to /home/(my name).
Please help!
Sophia Turcios
(1 rep)
Sep 23, 2024, 11:41 PM
• Last activity: Sep 24, 2024, 12:15 AM
5
votes
1
answers
889
views
How to securely connect to an SSH server that doesn't have a static IP address?
I have been attempting to set up an ARM home sever. The only issue is that I do not have a static IP address. I live in a very large apartment with shared wifi and therefore cannot easily enable local device networks. Are there any secure solutions that would allow me to SSH into my home server from...
I have been attempting to set up an ARM home sever.
The only issue is that I do not have a static IP address.
I live in a very large apartment with shared wifi and therefore cannot easily enable local device networks.
Are there any secure solutions that would allow me to SSH into my home server from anywhere without a static IP?
Kitty Cat
(157 rep)
Sep 5, 2024, 01:57 AM
• Last activity: Sep 5, 2024, 05:01 PM
1
votes
1
answers
54
views
The difference in user home directories access from live USB sticks
I created two users on my Mint 21.3 system: * `user1` (1000) was created during installation * `user2` (1001) I added later Both have their home directories in `/home`, with exactly the same `drwxr-x---` permissions. Neither is encrypted. The problem is that none of the distros I tried as live USB s...
I created two users on my Mint 21.3 system:
*
user1
(1000) was created during installation
* user2
(1001) I added later
Both have their home directories in /home
, with exactly the same drwxr-x---
permissions. Neither is encrypted.
The problem is that none of the distros I tried as live USB sticks (Ubuntu and flavors, Mint, Fedora and spins) allow me to access /home/user2
. Most but not all allow /home/user1
. The only difference between the users is that user1
is an administrator and user2
is not.
My question: why does it happen?
sigil
(177 rep)
Aug 10, 2024, 12:02 PM
• Last activity: Aug 10, 2024, 12:10 PM
19
votes
9
answers
99621
views
umount /home does not work
I trying to merge my separate /home partition with my / partition in linux mint 13. I was told to umount /home, mount it on a different location and copy the contents to the /home directory on the / partition. I have tried, but I cannot umount /home. When I try to do so, I get a message: umount: /ho...
I trying to merge my separate /home partition with my / partition in linux mint 13.
I was told to umount /home, mount it on a different location and copy the contents to the /home directory on the / partition.
I have tried, but I cannot umount /home. When I try to do so, I get a message:
umount: /home device is busy (which processes use this device can be possibly be found with lsof or fuser)
How can I unmount my /home and mount it on a separate location (/dev/sda2/mnt/home) to be able to copy the contents to /home?
DutchArjo
(787 rep)
May 10, 2014, 07:47 PM
• Last activity: Jul 13, 2024, 10:16 AM
0
votes
2
answers
75
views
Rename mounted home directory
I have the following situation, where I have a folder `/new_home`, and a mount in `etc/fstab`: `/new_home /home none bind 0 0` So that means that `/home` does exist, and is a mount point, and `/new_home` is a directory that contains the actual files. Now I would like to get rid of the mount and rena...
I have the following situation, where I have a folder
/new_home
, and a mount in etc/fstab
:
/new_home /home none bind 0 0
So that means that /home
does exist, and is a mount point, and /new_home
is a directory that contains the actual files.
Now I would like to get rid of the mount and rename /new_home
to /home
.
The problem is, I cannot unmount or move /home
because I am afraid that might crash the system / GUI.
Is that possible?
Thomas Hirsch
(103 rep)
Jul 1, 2024, 08:49 PM
• Last activity: Jul 1, 2024, 11:27 PM
-1
votes
1
answers
42
views
MacOS: I have a home directory within my home directory
[![running ls][1]][1] [1]: https://i.sstatic.net/H3dUEBDO.png I have never seen my home directory in my home directory until recently. Is this something I need to be worried about? I do not know if this is something problematic.

Cimpera
(1 rep)
Jun 23, 2024, 08:15 PM
• Last activity: Jun 23, 2024, 09:11 PM
0
votes
1
answers
326
views
RAID home directory setup
I have ubuntu 24.04 LTS on a SSD. I setup a software RAID5 with 3 HDDs. The RAID is mounted on `/mnt/md0` Here is my questions: I want the home directory to be in the RAID drives instead of the SSD. Basically, users would work from the RAID drives instead because the RAID drives have a lot more spac...
I have ubuntu 24.04 LTS on a SSD. I setup a software RAID5 with 3 HDDs. The RAID is mounted on
/mnt/md0
Here is my questions:
I want the home directory to be in the RAID drives instead of the SSD. Basically, users would work from the RAID drives instead because the RAID drives have a lot more space.
I have tried:
1. useradd -d
to add new users in a home directory in /mnt/md0/home/user
. But this created login issues, probably snap related, and Firefox doesn't like it.
2. Someone suggested me to mount /dev/md0
, which is my RAID drives to /home. ubuntu REALLY doesn't like it and I couldn't even boot up again and I had to reinstall.
What is the proper way to do it?
Thank you
edit 1:
No I am not using LVM. Seems complicated.
ttn1883
(11 rep)
Jun 3, 2024, 06:12 PM
• Last activity: Jun 11, 2024, 10:48 AM
0
votes
1
answers
62
views
Question about home directory permissions script
When setting Azure policy on a Linux VM, Microsoft uses the OMS agent to configure everything, in particular, the omsremediate command. Looking through their GitHub site for the OMS agent for Linux, I found their oms_audit.xml file, which lists audit findings and remediations for various policy item...
When setting Azure policy on a Linux VM, Microsoft uses the OMS agent to configure everything, in particular, the omsremediate command. Looking through their GitHub site for the OMS agent for Linux, I found their oms_audit.xml file, which lists audit findings and remediations for various policy items (https://github.com/Microsoft/OMS-Agent-for-Linux/blob/master/source/code/plugins/oms_audits.xml ). Audit finding #28 (fix-home-dir-permissions) states that home directory permissions should be set to 750 or more restrictive. Looking at the remediation for this further down in the file, MS provides this script snippet to fix the problem:
chmod 750 /home/*
if [ -e /var/lib/libuuid ]; then
chmod 750 /var/lib/libuuid
fi
chmod 750 /var/run/dbus
chmod 750 /var/run/dbus
# /var/run/sshd created by service at bootup
if [ -e /etc/init.d/ssh ]; then
sed -i 's/\(chmod\s\+\)[0-7]\{4\}/\10750/g' /etc/init.d/ssh
fi
if [ -e /etc/init.d/sshd ]; then
sed -i 's/\(chmod\s\+\)[0-7]\{4\}/\10750/g' /etc/init.d/sshd
fi
if [ -e /etc/init/ssh.conf ]; then
sed -i 's/\(mkdir\s\+-p\s\+-m\)[0-9]\{4\}/\10750/g' /etc/init/ssh.conf
fi
The first line, I understand. It's setting everything under /home to 750. But what about the next several lines? Is this an error or is there a reason to be changing permissions on /var/lib/libuuid, /var/run/dbus, /etc/init.d/ssh, /etc/init.d/sshd, and /etc/init/ssh.conf? I'm trying to figure out if those lines in the snippet belong under the "fix home dir permissions" section or if they should be somewhere else? I'm trying to translate an existing script that makes extensive use of omsremediate into a script that simply uses native Linux commands, depending on the distro. Anyone have any insight as to why these additional lines would fall under the "fix home dir permissions" section?
msaacs
(1 rep)
May 14, 2024, 06:05 PM
• Last activity: May 15, 2024, 02:10 AM
2
votes
1
answers
363
views
Can't change to Home directory on log in from console
I've been having a strange problem with my Fedora 39 install. I don't have a display manager, so the computer boots to the console. When I log in as my user, I get an error: -- fab: /home/fab: change directory failed: Permission denied Logging in with home = "/" Once I'm logged in, I can cd to my ho...
I've been having a strange problem with my Fedora 39 install. I don't have a display manager, so the computer boots to the console. When I log in as my user, I get an error:
-- fab: /home/fab: change directory failed: Permission denied
Logging in with home = "/"
Once I'm logged in, I can cd to my home (/home/fab) and start my graphics session.
I have verified that in /etc/passwd, my home is indeed /home/fab and not /
My user "fab" owns /home/fab, the directory is rw, /home is mounted as rw, and my user can modify/delete/create files and directories in /home/fab
Have I missed something obvious? Does anybody have an idea what's going on? Thanks!
**Edit**: I have tried to
ssh fab@machine
and su - fab
on this machine from the console once logged in; I tried with the fab
account, and the root
account; every time, I was asked for my password (I don't have ~/.ssh/authorized_keys
setup), and I was directly logged in in the HOME directory, with no message of permission denied.
I also tried from another machine with ssh fab@machine
, and was logged in directly in HOME again, with no permission error.
So it seems that the permission error only occurs when I log in on the console of the machine!
Furthermore, the machine from which I ssh
ed is also under Fedora 39, and I logged in in the console (but there is also a display manager running), and I didn't get the permission error. So there is a misconfiguration on the machine which gives the error, but where?
Thanks again for the inputs!
user3605616
(21 rep)
May 1, 2024, 04:28 PM
• Last activity: May 3, 2024, 12:58 PM
Showing page 1 of 20 total questions