User Tools

Site Tools


mount_usb_drive_on_boot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mount_usb_drive_on_boot [2016/07/28 21:38] – created walkeradminmount_usb_drive_on_boot [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 2: Line 2:
 \\  \\ 
 \\  \\ 
-Having created a partition, formatted it and mounted it, the mounting temporary and will be lost upon reboot. To mount it at boot we can do the following:+Having created a partition, formatted it and mounted it, the mounting is temporary and will be lost upon reboot. To mount it at boot we can do the following:
 \\  \\ 
 \\  \\ 
Line 10: Line 10:
          
     (on my system that is the SD card we booted from and a single USB Hard Disk)     (on my system that is the SD card we booted from and a single USB Hard Disk)
 +    
     total 0     total 0
     lrwxrwxrwx 1 root root 15 Jul 28 20:33 0403-0201 -> ../../mmcblk0p1     lrwxrwxrwx 1 root root 15 Jul 28 20:33 0403-0201 -> ../../mmcblk0p1
Line 21: Line 21:
          
     The assignment ending in /sda1 is what I am interested in.     The assignment ending in /sda1 is what I am interested in.
 +\\ 
 +    Note Down the value of the drive you wish to mount
 +    
 +    6af40af7-759f-4ee5-afea-882e9f58f17e (in this example)
 +\\ 
 +    Get the uid, gid for pi user and group using:
 +    
 +    id
 +    
 +    uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),997(gpio),998(i2c),999(spi)
 +    
 +    Here we can see the uid for pi is 1000 (I am assuming you are using the pi account)
 +\\ 
 +    Lets create a mount point and call it NewDisk 
 +    
 +    sudo mkdir /mydisk    <-- This creates a mount point (a folder) to mount our disk, the folder is called mydisk
 +\\ 
 +    To Mount the Disk
 +    
 +    sudo mount /dev/sda1 /NewDisk    <--- bear in mind that your disk might not be sda1
 \\  \\ 
  
 +    
  
          
mount_usb_drive_on_boot.1469738331.txt.gz · Last modified: 2023/03/09 22:35 (external edit)