Tuesday, February 28, 2017

Add HD and auto mount drive in linux (virtual)






Install the new VHD in your VM system.
Boot up the image.

fdisk –l

The circled item shows the new 100g drive that was added. "/dev/sdb"

FORMAT disk:

fdisk /dev/sdb


At the command prompt select " p " and press ENTER


Just double check to make sure the drive you are about to format name and size matches the one you installed
Now select option " N " and press enter
 

Now select option " P " for extended

The select Parition #1
For "FIRST SECTOR" and "END SECTOR" just press enter to accept defaults



Once thats done, select OPTION T


Select Partition 1 and then use option "L" to list your option codes to see them.



Select the option 83 (Linux) press ENTER

Now selection "W" to write your changes to the table

Now type the following:
mkfs –t ext2 /dev/sdb

That my take a couple of minutes for that command to complete.  When its done type in:
Type fsck /dev/sdb –f –y
The system should do some system checks, all of which should pass:

Reboot the system.

shutdown -r now

Once rebooted, we'll make a mounting point for this drive.  

mkdir /mnt/recordings

mount –t ext2 /dev/sdb /mnt/recordings

Now if you type "DF" you should see it in the list

type in the following:

cat /proc/mounts

look at the bottom, should see sdb reference

/dev/sdb /mnt/recordings ext2 rw 0 0

Might look something like this.  COPY that line then type

vi /etc/fstab/

paste the line above into the fstab and save it.  If yourdata has 'relatime' option.  change that to 'noatime'

save your changes..reboot


No comments:

Post a Comment