Mounting harddrives at bootup deterministically

Post Reply
jalcaid001
Posts: 73
Joined: Mon Nov 28, 2016 2:43 am
languages_spoken: english spanish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Mounting harddrives at bootup deterministically

Unread post by jalcaid001 » Fri Sep 06, 2019 8:17 pm

Hi

A couple of years with my XU4, I stopped being able to reboot with harddrives mounted. I had to mount them (mount command) manually after reboot

viewtopic.php?f=95&t=31289

Now I am using a new XU4 with the same eMMC card, and seems to be working again. Was this perhaps a HW issue?

Now that it's working, /etc/fstab seems empty. What is the correct way of doing it? Also, I'd like to identify them UUID instead of /dev/sda1 or /dev/sdb1 (this seem to be assigned at startup depending on which USB port I connect them)

Code: Select all

root@odroid:/home/odroid# uname -a
Linux odroid 3.10.103-124 #1 SMP PREEMPT Tue Oct 11 11:51:06 UTC 2016 armv7l armv7l armv7l GNU/Linux
root@odroid:/home/odroid#

Code: Select all

root@odroid:/home/odroid/Desktop# lsblk -o NAME,FSTYPE,UUID
NAME         FSTYPE UUID
sda
└─sda1       ntfs   92F65979F6595F13
sdb
└─sdb1       ntfs   BE602F06602EC4CD
mmcblk0boot0
mmcblk0boot1
mmcblk0
├─mmcblk0p1  vfat   52AA-6867
└─mmcblk0p2  ext4   e139ce78-9841-40fe-8823-96a304a09859

Code: Select all

root@odroid:/home/odroid/Desktop# df
Filesystem      1K-blocks       Used  Available Use% Mounted on
udev               758432          0     758432   0% /dev
tmpfs              203852      10784     193068   6% /run
/dev/mmcblk0p2   15015432    6163404    8336148  43% /
tmpfs             1019252        248    1019004   1% /dev/shm
tmpfs                5120          4       5116   1% /run/lock
tmpfs             1019252          0    1019252   0% /sys/fs/cgroup
/dev/mmcblk0p1     130798      12500     118298  10% /media/boot
tmpfs              203852         24     203828   1% /run/user/1000
/dev/sda1      4883736572 4845750728   37985844 100% /media/odroid/EXT1
/dev/sdb1      7814024188 1385178208 6428845980  18% /media/odroid/EXT2
root@odroid:/home/odroid/Desktop# cat /etc/fstab
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
root@odroid:/home/odroid/Desktop# fgrep /dev/sd /etc/mtab
/dev/sda1 /media/odroid/EXT1 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
/dev/sdb1 /media/odroid/EXT2 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
root@odroid:/home/odroid/Desktop# fgrep /dev/sd /proc/mounts
/dev/sda1 /media/odroid/EXT1 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
/dev/sdb1 /media/odroid/EXT2 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
root@odroid:/home/odroid/Desktop#

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by mad_ady » Fri Sep 06, 2019 9:09 pm

I'd suggest using autofs to mount them by uuid instead of fstab. They get unmounted when not in use (less chance of fs corruption on power outage) and automounted when needed. Also if the disks aren't present it won't stall your boot.

jalcaid001
Posts: 73
Joined: Mon Nov 28, 2016 2:43 am
languages_spoken: english spanish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by jalcaid001 » Wed Sep 11, 2019 7:38 am

Thanks

There is not a 'native' way of doing that? Just adding something to a file?

Do I really need to get this package?

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by mad_ady » Wed Sep 11, 2019 1:45 pm

fstab with UUIDs will do the trick as well

jalcaid001
Posts: 73
Joined: Mon Nov 28, 2016 2:43 am
languages_spoken: english spanish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by jalcaid001 » Wed Sep 11, 2019 6:09 pm

Ok.. I tried that but didn't work

I modify the file

Code: Select all

root@odroid:/home/odroid# cat /etc/fstab
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
UUID=92F65979F6595F13 /media/odroid/EXT1 ntfs defaults 0 0
UUID=BE602F06602EC4CD /media/odroid/EXT2 ntfs defaults 0 0
LABEL=boot /media/boot vfat defaults 0 1
root@odroid:/home/odroid#
Then I reboot and I get errors

Code: Select all

root@odroid:/home/odroid# df
df: /media/odroid/EXT2: Transport endpoint is not connected
df: /media/odroid/EXT1: Transport endpoint is not connected
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              758432       0    758432   0% /dev
tmpfs             203852    8092    195760   4% /run
/dev/mmcblk0p2  15015432 6169464   8330088  43% /
tmpfs            1019252       0   1019252   0% /dev/shm
tmpfs               5120       4      5116   1% /run/lock
tmpfs            1019252       0   1019252   0% /sys/fs/cgroup
/dev/mmcblk0p1    130798   12500    118298  10% /media/boot
tmpfs             203852       4    203848   1% /run/user/110
tmpfs             203852       0    203852   0% /run/user/1000
root@odroid:/home/odroid#

Code: Select all

root@odroid:/home/odroid# lsblk -o NAME,FSTYPE,UUID
NAME         FSTYPE UUID
sda
└─sda1       ntfs   92F65979F6595F13
sdb
└─sdb1       ntfs   BE602F06602EC4CD
mmcblk0boot0
mmcblk0boot1
mmcblk0
├─mmcblk0p1  vfat   52AA-6867
└─mmcblk0p2  ext4   e139ce78-9841-40fe-8823-96a304a09859
root@odroid:/home/odroid#

I have to remove those extra lines on /etc/fstab, reboot, and mount manually (mount command). But now I am not even able to get those mounts after reboot (!). I have to do the manual mount everytime after reboot. So I srewed it up

What's going on? Is there some state kept some other place?

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by mad_ady » Wed Sep 11, 2019 7:52 pm

Not sure what's wrong, since I don't use NTFS. See if anything from here is relevant: https://bbs.archlinux.org/viewtopic.php?id=146157

jalcaid001
Posts: 73
Joined: Mon Nov 28, 2016 2:43 am
languages_spoken: english spanish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by jalcaid001 » Thu Sep 12, 2019 2:46 am

So it seems like a bug that was never fixed.

But my question still applies.. It was working before. So there must be some state kept in some file somewhere disallowing the mount at reboot. Any idea where this state could be?

I can always buy another XU4 or use another image, but I would like to avoid it

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by mad_ady » Thu Sep 12, 2019 1:39 pm

Why not try the autofs route? I'm using it and I'm happy with it. The difference is mounting is done on demand, so later in the boot process, so it may make a difference.

jalcaid001
Posts: 73
Joined: Mon Nov 28, 2016 2:43 am
languages_spoken: english spanish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Mounting harddrives at bootup deterministically

Unread post by jalcaid001 » Tue Sep 17, 2019 12:08 am

Becauase this is a feature trying to workaround something vanilla that should be working ;-)

I played some more with it. I tried the same with a couple of flash drives. /etc/fstab worked fine whether they were ext4 or ntfs

IF I go back to my TB HDDs, I still have problems:

- If I add lines to /etc/fstab, system does not boot and I have to modify /etc/fstab from the startup console and then reboot
- If I don't add any lines to /etc/fstab, now it seems the harddrives get mounted by default, to some predetermined folders /media/ordroid/EXT21 /media/ordrod/EXT1. Those folders don't have to pre-exists before rebooting. I may have used those folders in the past, but now they are somehow 'stucked' in the system.

How can I remove that state? Should I just do a search in all the files to try to match 'EXT21' ?

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests