Changes

From Amahi Wiki
Jump to: navigation, search
3,659 bytes added ,  01:36, 31 July 2011
no edit summary
{{Code|
mkfs.ext4 -T largefile4 /dev/sdb1
}}
 
=Adding the drive to your HDA=
Normally to add a drive to Amahi, you would run the script hda-diskmount, which searches for any unmounted drives and mounts them. Unfortunately, this script doesn't yet cater for GPT partitions. It runs an '''fdisk -l''' and searches out drives with a Linux system type, and with what it finds it mounts any that aren't mounted.
 
If we run '''fdisk -l''' by itself, we will see that our new drive doesn't return a system type of 'Linux', instead it returns 'GPT' as well as a warning:
 
{{Code|
Code= WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
 
 
Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
 
Device Boot Start End Blocks Id System
/dev/sdb1 1 4294967295 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.
}}
 
So hda-diskmount correctly ignores the drive.
 
First we make our mount point
 
{{Code|
mkdir /var/hda/files/drives/sdb1
}}
 
Next we exercise good practice and backup our fstab file, I like to use `date +%Y%m%d` to give the name a date stamp e.g. /etc/fstab.20110731 represents a backup done on the 31st of July, 2011. This isn't necessary, you could just use something like 'fstab.old', but date-stamping your file backups is a good habit to get into
{{Code|
Code= cp /etc/fstab /etc/fstab.`date +%Y%m%d`
}}
 
Now we adjust the fstab file
 
{{Code|
Code= echo -e /dev/sdb1$'\t\t'/var/hda/files/drives/sdb1$'\t'ext4$'\t'defaults$'\t'1 1 >> /etc/fstab
}}
 
What this does is adds a line to the /etc/fstab file, telling it that when Amahi boots, it has to mount the drive. The $'\t' entries simply mean 'put in a tab space'
 
If you now run '''cat /etc/fstab''' you should see a nice entry at the bottom, similar to this
 
{{Code|
Code= cat /etc/fstab
 
#
# /etc/fstab
# Created by anaconda on Thu Jul 28 23:56:48 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_hda-LogVol01 / ext4 defaults 1 1
UUID=cc1204dd-a4f8-42f8-8736-b5970251a865 /boot ext4 defaults 1 2
/dev/mapper/vg_hda-LogVol00 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 1
}}
 
Now you can either reboot to allow the fstab file to mount your new drive, or you can simply run '''mount -a'''
 
Now if you run mount by itself, you should see your drive listed e.g.
 
{{Code|
Code= mount
/dev/mapper/vg_hda-LogVol01 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdd1 on /media/520abb16-ac7c-4f65-9cc3-9e536c93dca2 type ext4 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdb1 on /var/hda/files/drives/sdb1 type ext4 (rw)
}}
4

edits