LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux Mint (https://www.linuxquestions.org/questions/linux-mint-84/)
-   -   Create Mount Point (https://www.linuxquestions.org/questions/linux-mint-84/create-mount-point-4175720917/)

borgward 01-15-2023 12:09 AM

Create Mount Point
 
1 Attachment(s)
Installed Mint 21.1, Something else. sda7 has my home files. How do I create mount point /home there?

I can mount my home folder from the command line to the Desktop and open its files.

mrmazda 01-15-2023 12:26 AM

You haven't given many details. Did you have some other OS on sda5 before 21.1? If yes, was it mounting sda7 to /home? Please paste input/output here in plain text form from an X terminal from the following commands after mounting sda7 <somewhere> (e.g. /mnt):
  • sudo lsblk -f
  • cat /etc/fstab
  • ls -n ~/
  • ls -n /mnt/.* /mnt/*

borgward 01-15-2023 01:02 AM

mint 20.3 was on /dev/sda5. It was it mounting sda7 to /home.

tom@tom-1520:~$ sudo lsblk -f
[sudo] password for tom:
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1

├─sda5
│ ext4 1.0 1ef880e6-cdbe-4e06-bfa5-3c567cb8b1bd 41G 16% /
├─sda6
│ swap 1 093409f7-f0af-4c8f-a22c-5a3b3816a364 [SWAP]
└─sda7
ext4 1.0 9983149b-3a05-462b-96a6-939625e6c7b6
sr0
tom@tom-1520:~$ cat /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/sda5 during installation
UUID=1ef880e6-cdbe-4e06-bfa5-3c567cb8b1bd / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=093409f7-f0af-4c8f-a22c-5a3b3816a364 none swap sw 0 0
tom@tom-1520:~$ ls -n ~/
total 36
drwxr-xr-x 2 1000 1000 4096 Jan 14 23:27 Desktop
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Documents
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Downloads
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Music
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Pictures
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Public
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Templates
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Videos
drwxrwxr-x 2 1000 1000 4096 Jan 14 22:30 Warpinator
tom@tom-1520:~$ ls -n /mnt/.* /mnt/*
ls: cannot access '/mnt/*': No such file or directory
/mnt/.:
total 0

/mnt/..:
total 72
lrwxrwxrwx 1 0 0 7 Jan 14 22:09 bin -> usr/bin
drwxr-xr-x 3 0 0 4096 Jan 14 22:22 boot
drwxr-xr-x 2 0 0 4096 Jan 14 22:19 cdrom
drwxr-xr-x 20 0 0 4380 Jan 15 00:43 dev
drwxr-xr-x 145 0 0 12288 Jan 14 23:21 etc
drwxr-xr-x 3 0 0 4096 Jan 14 22:20 home
lrwxrwxrwx 1 0 0 7 Jan 14 22:09 lib -> usr/lib
lrwxrwxrwx 1 0 0 9 Jan 14 22:09 lib32 -> usr/lib32
lrwxrwxrwx 1 0 0 9 Jan 14 22:09 lib64 -> usr/lib64
lrwxrwxrwx 1 0 0 10 Jan 14 22:09 libx32 -> usr/libx32
drwx------ 2 0 0 16384 Jan 14 21:59 lost+found
drwxr-xr-x 3 0 0 4096 Jan 14 22:35 media
drwxr-xr-x 2 0 0 4096 Dec 17 09:08 mnt
drwxr-xr-x 2 0 0 4096 Dec 17 09:08 opt
dr-xr-xr-x 284 0 0 0 Jan 14 23:16 proc
drwx------ 3 0 0 4096 Jan 14 22:22 root
drwxr-xr-x 36 0 0 980 Jan 15 00:34 run
lrwxrwxrwx 1 0 0 8 Jan 14 22:09 sbin -> usr/sbin
drwxr-xr-x 2 0 0 4096 Dec 17 09:08 srv
dr-xr-xr-x 13 0 0 0 Jan 14 23:16 sys
drwxrwxrwt 16 0 0 4096 Jan 15 00:45 tmp
drwxr-xr-x 14 0 0 4096 Dec 17 09:08 usr
drwxr-xr-x 11 0 0 4096 Dec 17 09:43 var

mrmazda 01-15-2023 01:17 AM

Quote:

Originally Posted by borgward (Post 6404459)
Code:

/mnt/.:
total 0

/mnt/..:
total 72
lrwxrwxrwx  1 0 0    7 Jan 14 22:09 bin -> usr/bin
drwxr-xr-x  3 0 0  4096 Jan 14 22:22 boot
drwxr-xr-x  2 0 0  4096 Jan 14 22:19 cdrom
drwxr-xr-x  20 0 0  4380 Jan 15 00:43 dev
drwxr-xr-x 145 0 0 12288 Jan 14 23:21 etc
drwxr-xr-x  3 0 0  4096 Jan 14 22:20 home
lrwxrwxrwx  1 0 0    7 Jan 14 22:09 lib -> usr/lib
lrwxrwxrwx  1 0 0    9 Jan 14 22:09 lib32 -> usr/lib32
lrwxrwxrwx  1 0 0    9 Jan 14 22:09 lib64 -> usr/lib64
lrwxrwxrwx  1 0 0    10 Jan 14 22:09 libx32 -> usr/libx32
drwx------  2 0 0 16384 Jan 14 21:59 lost+found
drwxr-xr-x  3 0 0  4096 Jan 14 22:35 media
drwxr-xr-x  2 0 0  4096 Dec 17 09:08 mnt
drwxr-xr-x  2 0 0  4096 Dec 17 09:08 opt
dr-xr-xr-x 284 0 0    0 Jan 14 23:16 proc
drwx------  3 0 0  4096 Jan 14 22:22 root
drwxr-xr-x  36 0 0  980 Jan 15 00:34 run
lrwxrwxrwx  1 0 0    8 Jan 14 22:09 sbin -> usr/sbin
drwxr-xr-x  2 0 0  4096 Dec 17 09:08 srv
dr-xr-xr-x  13 0 0    0 Jan 14 23:16 sys
drwxrwxrwt  16 0 0  4096 Jan 15 00:45 tmp
drwxr-xr-x  14 0 0  4096 Dec 17 09:08 usr
drwxr-xr-x  11 0 0  4096 Dec 17 09:43 var


The command I gave ls -n /mnt/.* /mnt/* was based upon the presumption that you mounted /dev/sda7 to /mnt before running the command, so the above is useless, showing only the content of /. The object of the command was to see if the owner and group numbers matched those of the previous command. Does ls -n on wherever sda7 is mounted show all as owner 1000 and group 1000 as you see in the output from ls -n ~/? If it does, then the output is no longer needed for me to compose a response to the rest of your reply.

borgward 01-15-2023 01:26 AM

can't mount /dev/sda7

mrmazda 01-15-2023 01:42 AM

Quote:

Originally Posted by borgward (Post 6404462)
can't mount /dev/sda7

How did you try? sudo mount /dev/sda7 /mnt should mount it on /mnt/. What happens when you try to mount it?

borgward 01-15-2023 10:10 AM

All my files are available at /mnt

mrmazda 01-15-2023 10:26 AM

Quote:

Originally Posted by borgward (Post 6404509)
All my files are available at /mnt

Are all files 1000:1000 owner:group there, like they are in ~/?

borgward 01-15-2023 11:11 AM

tom@tom-1520:/mnt$ ls -n ~/
total 36
drwxr-xr-x 2 1000 1000 4096 Jan 14 23:27 Desktop
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Documents
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Downloads
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Music
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Pictures
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Public
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Templates
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Videos
drwxrwxr-x 2 1000 1000 4096 Jan 14 22:30 Warpinato

I presume so.

mrmazda 01-15-2023 11:58 AM

We already knew all in ~/ were 1000:1000. Are they, or are they not 1000:1000 on wherever you have succeeded to mount sda7? Have you been saying that you have never managed to mount sda7 anywhere since switching to 21.1?

There are potential booby traps here by not knowing the answer to the issue of numeric owner:group of files on sda7, but to mount it on /home, boot rescue media and use it to edit /etc/fstab to include the following line:
Code:

UUID=9983149b-3a05-462b-96a6-939625e6c7b6 /home ext4 defaults 0 2
Alternatively, create a login for root[1], then login as root, then perform the edit, reboot, then login normally. This simplistic process will hide all files that currently exist in /home. If those files are unimportant to you, you may login as root and delete them all before performing the fstab edit and reboot.

After the procedure, either from rescue media or via root login, inspect /home/ with ls -l and ls -n to see if your normal username and files are there. If they are, all may be good to go as your normal user.

If there are already files you need to keep in your 21.1 homedir, you'll need to back them up, then after the process of getting sda7 mounted on /home, restore them.

[1] to create root login:
Code:

sudo passwd root

borgward 01-15-2023 12:36 PM

Quote:

Originally Posted by mrmazda (Post 6404550)
We already knew all in ~/ were 1000:1000. Are they, or are they not 1000:1000 on wherever you have succeeded to mount sda7? Have you been saying that you have never managed to mount sda7 anywhere since switching to 21.1?

I presume sda7 is mounted. From Nemo I can go to File System click on mnt, open tom and see and open my files that are in ssda7

tom@tom-1520:/mnt/tom$ ls -n ~/
total 36
drwxr-xr-x 2 1000 1000 4096 Jan 14 23:27 Desktop
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Documents
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Downloads
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Music
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Pictures
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Public
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Templates
drwxr-xr-x 2 1000 1000 4096 Jan 14 22:30 Videos
drwxrwxr-x 2 1000 1000 4096 Jan 14 22:30 Warpinator
tom@tom-1520

mrmazda 01-15-2023 01:23 PM

What do mount | grep sda and df report?

borgward 01-15-2023 01:27 PM

tom@tom-1520:~$ mount | grep sda
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda7 on /mnt type ext4 (rw,relatime)
tom@tom-1520:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 400848 1500 399348 1% /run
/dev/sda5 54671512 8839164 43022704 18% /
tmpfs 2004236 0 2004236 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 400844 1668 399176 1% /run/user/1000
/dev/sda7 661891928 334687724 293555412 54% /mnt
tom@tom-1520:~$

borgward 01-15-2023 03:50 PM

Sorry about all the bother. During the install I did not choose ext4 for sda7 thinking it was already ext4 and selecting ext4 would wipe my files.

mrmazda 01-15-2023 03:50 PM

That shows you managed to mount sda7 on /mnt. :) So, now you can examine /mnt with ls -n /mnt to see if its content is all 1000:1000. If it is, make the /etc/fstab edit and then then reboot.


All times are GMT -5. The time now is 10:09 PM.