Changes

From SME Server
Jump to navigationJump to search
1,139 bytes added ,  19:36, 4 November 2015
Line 206: Line 206:  
  sh hal-find-by-property.sh
 
  sh hal-find-by-property.sh
   −
The output will tell you the device, volume label, file system type, and the uid. You have to use the device in the mount command and you will need a directory to mount the device to. Note the directory has to exist for the command to process.
+
The output will tell you the device, volume label, file system type, and the uid. If this is a new drive you have to run fdisk to create a partition and format the drive before you can mount it.
 +
 
 +
To create a partition with fdisk, use the device output from the hal-find-by-property.sh script as the argument to the fdisk command. If the output from hal-find-by-property.sh is /dev/sdb1 the fdisk command will be
 +
fdisk /dev/sdb1
 +
 
 +
You can list the partitions on the disk by entering the p command when prompted. It's a good idea to see what partitions exist before you start. If the drive is pre-formatted for fat or ntfs it's good practice to delete the factory partitions.
 +
 
 +
If this is a new drive, you will need to create a new primary partition. Do this by entering an n at the prompt followed by p for primary. Enter a partition number of 1. fdisk will then ask for the first and last sector. If you are formatting a new disk, hit enter at both questions. This will use the entire disk. When the process ends, hit p to verify you have the disk setup like you want it. Once you are happy with the partition table, hit w to write the partition table and exit fdisk.
 +
 
 +
You now need to format the drive. ext4 is recommended. To format the drive with an ext4 filesystem located at /dev/sdb1 and give it a label of usbdrive, issue the following command:
 +
mkfs ext4 -L usbdrive /dev/sdb1
    
To check a mount point exists and mount
 
To check a mount point exists and mount
70

edits

Navigation menu