Mount partitions automatically

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Mount partitions automatically

Post by ouzel »

Ciao,
I would appreciate some advice on how to automatically mount two partitions from which I have recently removed Windows 7, they are /dev/sdb2 and /dev/sdb5 as shown below
no win7 partitions not mounted 17 feb 2021.png
Also, should it be possible to merge /dev/sdb5 with /dev/sdb6 and if so please explain how this is done.

I have searched for answers to these questions but haven't found anything that seems to be fully relevant.

Best regards
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
it-place
Level 3
Level 3
Posts: 188
Joined: Thu Jul 05, 2018 4:42 am

Re: Mount partitions automatically

Post by it-place »

Hi ouzel,

well, the first part of the problem is quite easy. Just add the partition you want to mount to your /etc/fstab file:
sudo su
blkid | grep /dev/sdb2
mkdir /disk1
Add a new line to /etc/fstab like
UUID=caa8285a-e976-4be2-bdae-0e4ee919839b /disk1 ext4 defaults 0 2
where UUID is the ID you got from the blkid command. The disk /dev/sdb2 will be mounted on /disk1 (or any other name you choose for /disk1).

For the merge you have to move all data from /dev/sda5 to /dev/sda6. Then you can use GParted to delete sda5 and extend sda6 to maximum size.

:!: Warning! Be careful. Before using GParted it is highly recommended the backup all your data! :!:

Regards - Olli
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Re: Mount partitions automatically

Post by ouzel »

Olli,
Thank you for your response.

I am reasonably sure that I understand your instructions and will post the results when finished.

Best regards
ajgreeny
Level 7
Level 7
Posts: 1652
Joined: Mon Nov 19, 2007 3:27 pm

Re: Mount partitions automatically

Post by ajgreeny »

Probably you will need to do all this from a live USB system, though it is impossible to know what all those partitions really are at the moment.
Is the large ext4 partition the root partition of your Mint installation? If so you will definitely need to do all this from a live system with all partitions unmounted as you can not act on any mounted partitions using gparted.

To clarify things a bit more show us the output of these three commands

Code: Select all

mount
sudo blkid
sudo fdisk -l
User avatar
AndyMH
Level 21
Level 21
Posts: 13696
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Mount partitions automatically

Post by AndyMH »

Probably you will need to do all this from a live USB system
No, you will need to do this from a live usb. e.g your mint install stick. sdb6 is your / partition and you can't change that booting normally. Using gparted, you would need to delete sdb5 and then extend sdb6 into the space created. You have over 130GB of stuff in sdb6, it will take a long time.

It will work, but make sure you have a backup first.

Looks like a 320GB HDD, I'd be tempted to do a fresh install. You are booting in legacy mode, so could just have one single ext4 partition using the whole drive.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ajgreeny
Level 7
Level 7
Posts: 1652
Joined: Mon Nov 19, 2007 3:27 pm

Re: Mount partitions automatically

Post by ajgreeny »

Just to be sure what we are dealing with here, can you tell us what is on /dev/sda.
All the partitions shown in your image are on /dev/sdb which normally means there is another phtsical disk in your system which could have other Linux partitions, perhaps even a root partition of the OS you are running.
This is precisely why I asked you to show us the output of those three commands.
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Re: Mount partitions automatically

Post by ouzel »

Thanks for your responses, the outputs from the three commands follow below and the attached file is a screenshot of the partitions prior to my removal of Windows 7.

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,nosuid,relatime,size=915672k,nr_inodes=228918,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,noexec,relatime,size=189804k,mode=755)
/dev/sdb6 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/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
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/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=41,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13087)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/var/lib/snapd/snaps/core_10823.snap on /snap/core/10823 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/dotnet-sdk_107.snap on /snap/dotnet-sdk/107 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/midori_550.snap on /snap/midori/550 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_1944.snap on /snap/core18/1944 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/midori_451.snap on /snap/midori/451 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_10583.snap on /snap/core/10583 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/dotnet-sdk_112.snap on /snap/dotnet-sdk/112 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_1988.snap on /snap/core18/1988 type squashfs (ro,nodev,relatime,x-gdu.hide)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=189800k,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/fuse on /run/user/1000/doc type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

sudo blkid
[sudo] password for niall:
/dev/sdb1: LABEL="SYSTEM" UUID="AC98A19298A15C18" TYPE="ntfs" PARTUUID="79a7d193-01"
/dev/sdb2: UUID="3c25881e-bc81-416f-acf5-2c9fcc709c42" TYPE="ext4" PARTUUID="79a7d193-02"
/dev/sdb5: UUID="8e7d5ca6-78e9-40df-95e3-3f0a99dfd22f" TYPE="ext4" PARTUUID="79a7d193-05"
/dev/sdb6: UUID="3e3dd334-8859-40ee-aa6b-241362ae7e58" TYPE="ext4" PARTUUID="79a7d193-06"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"

sudo fdisk -l
Disk /dev/loop0: 98.4 MiB, 103129088 bytes, 201424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 128.4 MiB, 134610944 bytes, 262912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 160.8 MiB, 168570880 bytes, 329240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 55.4 MiB, 58073088 bytes, 113424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 128.4 MiB, 134619136 bytes, 262928 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 160.7 MiB, 168509440 bytes, 329120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 55.5 MiB, 58159104 bytes, 113592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 97.9 MiB, 102637568 bytes, 200464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x79a7d193

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 821247 819200 400M 27 Hidden NTFS WinRE
/dev/sdb2 821248 210536447 209715200 100G 83 Linux
/dev/sdb3 210538494 625141759 414603266 197.7G f W95 Ext'd (LBA)
/dev/sdb5 210538496 367824895 157286400 75G 83 Linux
/dev/sdb6 367826944 625141759 257314816 122.7G 83 Linux
Attachments
partitions 17 feb 2021.png
User avatar
AndyMH
Level 21
Level 21
Posts: 13696
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Mount partitions automatically

Post by AndyMH »

Please read this:
viewtopic.php?f=29&t=338297
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Re: Mount partitions automatically

Post by ouzel »

Thank you for the very informative link.

With regard to my original query I think the solution that I will adopt is your suggestion of a fresh install, this seems to me to be the simplest and best solution.

Best regards
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Re: Mount partitions automatically

Post by ouzel »

I have done a fresh install of Mint 20.1 and changed the partitions using the installation DVD; many thanks for pointing me in the right direction.

My remaining question is regarding a swap file or a swap partition; I have looked at the link below but there does not seem to be an agreed conclusion

viewtopic.php?t=303359

Is a swap file or a swap partition recommended, I ask because the installation that I have just done did not automatically create a swap partition so I made one manually.

Best regards
ajgreeny
Level 7
Level 7
Posts: 1652
Joined: Mon Nov 19, 2007 3:27 pm

Re: Mount partitions automatically

Post by ajgreeny »

ouzel wrote: Sat Feb 20, 2021 1:51 pm I have done a fresh install of Mint 20.1 and changed the partitions using the installation DVD; many thanks for pointing me in the right direction.

My remaining question is regarding a swap file or a swap partition; I have looked at the link below but there does not seem to be an agreed conclusion

viewtopic.php?t=303359

Is a swap file or a swap partition recommended, I ask because the installation that I have just done did not automatically create a swap partition so I made one manually.

Best regards
If it did not create a swap partition it will have created a swap file, so don't worry.
I can't remember when a swap file became the default instead of a partition but it's been doing so for for a few releases now.
To double check run command

Code: Select all

free -mw
The bottom line of the output will show your swap size in megabytes, probably 947, and the amount in use at that moment
User avatar
AndyMH
Level 21
Level 21
Posts: 13696
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Mount partitions automatically

Post by AndyMH »

I've still got a swap partition, but only because I've always had one. Automatically using a swap file was introduced in LM19. I think the only reason to have a swap partition now is if you want to hibernate (which I don't).
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ouzel
Level 1
Level 1
Posts: 23
Joined: Thu Nov 19, 2020 12:52 pm
Location: Idir na sléibhte agus an trá

Re: Mount partitions automatically

Post by ouzel »

Ok and thanks.

The output from

Code: Select all

free -mw
follows below:
total used free shared buffers cache available
Mem: 1847 980 169 95 55 641 599
Swap: 2047 25 2022
shawnfromnh

Re: Mount partitions automatically

Post by shawnfromnh »

ouzel wrote: Wed Feb 17, 2021 4:04 pm Ciao,
I would appreciate some advice on how to automatically mount two partitions from which I have recently removed Windows 7, they are /dev/sdb2 and /dev/sdb5 as shown belowno win7 partitions not mounted 17 feb 2021.png

Also, should it be possible to merge /dev/sdb5 with /dev/sdb6 and if so please explain how this is done.

I have searched for answers to these questions but haven't found anything that seems to be fully relevant.

Best regards
For the new people that are on the forum reading. I had this problem, none of my partition on my 10tb sata drive were showing up. I went on a hunch to my user account and I was on the sambashare group. Then I opened Synaptic and I was right, the program samba that was around in 2016 when I first used Mint Cinnamon was not installed even thought the group was created. Likely just an oversite on the setup not having samba installed. DO NOT if running xfce or cinnamon desktop install the samba2k since I looked and it installs a lot of files starting with K so I assume from experience that they are kde files and might not play so well with other desktops. I saw my drives in lsblk and gparted so I installed samba rebooted and they were on the desktop after a necessary reboot.

This is so much safer for a new user than to edit the fstab and forbid they have a mistype or choose wrong on something or type ro instead of rw on a partition and have no idea that was why they cannot access that partition. The samba install is the mistake resistant way I chose. I'm just putting this out for the new people that have come from windows and welcome to linux. :D
Locked

Return to “Storage”