Editing fstab to mount partitions on a second hard drive

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
terry_g
Level 1
Level 1
Posts: 46
Joined: Mon Aug 28, 2017 11:10 am

Editing fstab to mount partitions on a second hard drive

Post by terry_g »

Can I edit my fstab file the same way I did with Fedora?
I installed a second hard drive and created 4 ext4 partitions using gparted.
I created mount points for them in /mnt they are /sdb2 /sdb3 and /sdb4.
Here is a copy of my fstab with the last 3 lines that I added commented out.

Thanks Terry

# /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>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=f02d2789-9504-40b7-be9f-30f90cb02096 /boot ext2 defaults 0 2
/dev/mapper/mint--vg-swap_1 none swap sw 0 0

#UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 0 0

#UUID=fea67933-4d12-4d49-a503-12ac79809242 /mnt/sdb3 ext4 0 0

#UUID=53cb29a4-f21e-4687-96e6-cb8debe65c00 /mnt/sdb4 ext4 0 0
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.
terry_g
Level 1
Level 1
Posts: 46
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g »

I see my first mistake i did not include "defaults" in each added line.
I know if I mess it up I can end with a non booting computer.
Terry


# /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>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=f02d2789-9504-40b7-be9f-30f90cb02096 /boot ext2 defaults 0 2
/dev/mapper/mint--vg-swap_1 none swap sw 0 0

#UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 defaults 0 0

#UUID=fea67933-4d12-4d49-a503-12ac79809242 /mnt/sdb3 ext4 defaults 0 0

#UUID=53cb29a4-f21e-4687-96e6-cb8debe65c00 /mnt/sdb4 ext4 defaults 0 0
WharfRat

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat »

They look good - I would just suggest adding errors=remount-ro after defaults so it looks like

UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 defaults,errors=remount-ro 0 0
terry_g
Level 1
Level 1
Posts: 46
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g »

What does errors=remount-ro do?

Terry
WharfRat

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat »

terry_g wrote: Thu Apr 19, 2018 11:58 pm What does errors=remount-ro do?

Terry
If an error is detected it will remount the filesystem read only to prevent further corruption otherwise it will just mark the filesystem as erroneous and continue which is the default set in the superblock.
terry_g
Level 1
Level 1
Posts: 46
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g »

Thanks For your help The partitions are mounting where I wanted them.
I transferred all my photos and important files into them there were over 16,000.

Terry
WharfRat

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat »

terry_g,

You might also consider setting the fs_passno to 2 and setting the Maximum mount count to 30 or so for periodic fsck during boot.
Locked

Return to “Storage”