Mounting the Partition/FileSystem
In order for the filesystem to be written to and read off, linux needs to "mount" the filesystem. Most Distros mount partitions automatically on boot, so if you reboot your board, you should see your new partition mounted after the next boot.
it is mounted here according to its partition UUID. However if you want more granularity, you can mount the filesystem/partition manually.
Firstly, unmount the mounted FS:
You can also use the mountpoint as the argument to unmount it, I just find using /dev/ easier to type or remember
Confirm its been unmounted:
For manually mounting and unmounting, there are two tools that can be used: mount and pmount.
pmount is a wrapper for the standard mount program and simplifies mounting and unmounting and allows a normal user to mount and unmount without root privileges.
Make sure you have internet connection and install pmount with the following command:
Confirm by typing in "y" followed by the enter key to install pmount.
After it is installed, invoke it to show current mounts and confirm that it is installed:
Mounting using pmount is exceptionally easy, you simply invoke the command with the first argument being the partition, and the second one being the mount location. In this case, lets say we want to mount it in a directory in /media/ .
.... And thats it! The filesystem on /dev/sda1 has been mounted on /media/USB-test. I didnt have to make a "USB-test" directory or anything, pmount did everything for me.
We can confirm it's been mounted using the lsblk tool:
Unmounting is done using the pumount command:
If you want to use the standard "mount" command that comes with almost all linux distributions, you'll need to do some preparation before mounting the partition.
Before you mount the partition, you will need to make sure that the mount directory exists. Create a new directory inside /media/
Use "ls" to confirm creation:
Mount the FS to the mount point ( "-t auto" means that we will let the mount tool automatically sort out the filesystem complexities) with the Partition as the first argument and the mount point as the second argument:
You can unmount the FS using the unmount tool:
Mounting using fstab will be covered in another guide, later on, I will link it back here.
In order for the filesystem to be written to and read off, linux needs to "mount" the filesystem. Most Distros mount partitions automatically on boot, so if you reboot your board, you should see your new partition mounted after the next boot.
Code:
rock64@rock64:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.9G 0 disk
└─sda1 8:1 1 14.9G 0 part /media/rock64/8ed85af6-dc70-42a5-ba49-c5bdda0a426e
mmcblk1 179:0 0 29.8G 0 disk
├─mmcblk1p1 179:1 0 3.9M 0 part
├─mmcblk1p2 179:2 0 64K 0 part
├─mmcblk1p3 179:3 0 4M 0 part
├─mmcblk1p4 179:4 0 4M 0 part
├─mmcblk1p5 179:5 0 4M 0 part
├─mmcblk1p6 179:6 0 112M 0 part /boot/efi
└─mmcblk1p7 179:7 0 29.7G 0 part /
it is mounted here according to its partition UUID. However if you want more granularity, you can mount the filesystem/partition manually.
Firstly, unmount the mounted FS:
Code:
sudo umount /dev/sda1
You can also use the mountpoint as the argument to unmount it, I just find using /dev/ easier to type or remember
Code:
sudo umount /media/rock64/8ed85af6-dc70-42a5-ba49-c5bdda0a426e
Confirm its been unmounted:
Code:
rock64@rock64:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.9G 0 disk
└─sda1 8:1 1 14.9G 0 part
mmcblk1 179:0 0 29.8G 0 disk
├─mmcblk1p1 179:1 0 3.9M 0 part
├─mmcblk1p2 179:2 0 64K 0 part
├─mmcblk1p3 179:3 0 4M 0 part
├─mmcblk1p4 179:4 0 4M 0 part
├─mmcblk1p5 179:5 0 4M 0 part
├─mmcblk1p6 179:6 0 112M 0 part /boot/efi
└─mmcblk1p7 179:7 0 29.7G 0 part /
For manually mounting and unmounting, there are two tools that can be used: mount and pmount.
pmount is a wrapper for the standard mount program and simplifies mounting and unmounting and allows a normal user to mount and unmount without root privileges.
Make sure you have internet connection and install pmount with the following command:
Code:
sudo apt install pmount
Confirm by typing in "y" followed by the enter key to install pmount.
After it is installed, invoke it to show current mounts and confirm that it is installed:
Code:
rock64@rock64:~$ pmount
Printing mounted removable devices:
/dev/mmcblk1p7 on / type ext4 (rw,relatime)
/dev/mmcblk1p6 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
To get a short help, run pmount -h
Mounting using pmount is exceptionally easy, you simply invoke the command with the first argument being the partition, and the second one being the mount location. In this case, lets say we want to mount it in a directory in /media/ .
Code:
rock64@rock64:~$ pmount /dev/sda1 /media/USB-test
.... And thats it! The filesystem on /dev/sda1 has been mounted on /media/USB-test. I didnt have to make a "USB-test" directory or anything, pmount did everything for me.
We can confirm it's been mounted using the lsblk tool:
Code:
rock64@rock64:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.9G 0 disk
└─sda1 8:1 1 14.9G 0 part /media/USB-test
Unmounting is done using the pumount command:
Code:
sudo pumount /dev/sda1
If you want to use the standard "mount" command that comes with almost all linux distributions, you'll need to do some preparation before mounting the partition.
Before you mount the partition, you will need to make sure that the mount directory exists. Create a new directory inside /media/
Code:
sudo mkdir /media/USB-test2
Use "ls" to confirm creation:
Code:
rock64@rock64:~$ sudo mkdir /media/USB-test2
rock64@rock64:~$ ls /media/
pm1 rock64 USB-test2
Mount the FS to the mount point ( "-t auto" means that we will let the mount tool automatically sort out the filesystem complexities) with the Partition as the first argument and the mount point as the second argument:
Code:
rock64@rock64:~$ sudo mount -t auto -o rw /dev/sda1 /media/USB-test2/
sudo mount -t auto /dev/sda1 /media/USB-test2/
rock64@rock64:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.9G 0 disk
└─sda1 8:1 1 14.9G 0 part /media/USB-test2
mmcblk1 179:0 0 29.8G 0 disk
├─mmcblk1p1 179:1 0 3.9M 0 part
├─mmcblk1p2 179:2 0 64K 0 part
├─mmcblk1p3 179:3 0 4M 0 part
├─mmcblk1p4 179:4 0 4M 0 part
├─mmcblk1p5 179:5 0 4M 0 part
├─mmcblk1p6 179:6 0 112M 0 part /boot/efi
└─mmcblk1p7 179:7 0 29.7G 0 part /
You can unmount the FS using the unmount tool:
Code:
rock64@rock64:~$ sudo umount /dev/sda1
rock64@rock64:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.9G 0 disk
└─sda1 8:1 1 14.9G 0 part
mmcblk1 179:0 0 29.8G 0 disk
├─mmcblk1p1 179:1 0 3.9M 0 part
├─mmcblk1p2 179:2 0 64K 0 part
├─mmcblk1p3 179:3 0 4M 0 part
├─mmcblk1p4 179:4 0 4M 0 part
├─mmcblk1p5 179:5 0 4M 0 part
├─mmcblk1p6 179:6 0 112M 0 part /boot/efi
└─mmcblk1p7 179:7 0 29.7G 0 part /
Mounting using fstab will be covered in another guide, later on, I will link it back here.