Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
IMPORTANT NOTES:More hard drives can be added in your Amahi HDA for additional storage space.
* This is an '''advanced''We' howto on ll detail how to add a drive such hard drives, and how to your HDA* This page may need a refresh put them to make sure it matches the new script called hda-diskmount, based on the old script. Please edit this page if you find any issues that need to be corrected* Amahi cannot be held responsible for any data breakage or destruction arising from the good use or misuse of this script. We provide it as a service in good will. You accept this automatically if you use the script
=QuickstartImportant Notes=A secondary hard drive (fat32, ntfs, etc) can be added for additional storage in your Amahi HDA.
First thing's first, make sure your drive * This is an '''detectedadvanced''' by how-to on how to add additional drives to your HDA.* Amahi cannot be held responsible for any data breakage or destruction arising from the BIOS, connected properly and '''formatted''' properlyuse or misuse of this script. Once the BIOS sees We provide it, as a service in good will. You accept this automatically if you need to have it partitioneduse the script.
You can check this with the following command (run before and after connecting the (USB) disk):=Step by step instructions=
dmesg==Make sure your drive is detected by the BIOS==It should be listed in the drives that appear when you boot your computer, before the Fedora boot screen appears. You can also enter you BIOS and confirm they appear there.
You'll see something along ==Make sure your drive is detected by Fedora==Open a Terminal, and type the lines offollowing command:
USB Mass Storage device found at ..<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">ls -1 /dev/disk/by-id/ | egrep -v "part|scsi"</div>
followed by a Look for the line with a /dev/sd<x> devicethat match the hard drive you added.
<ul><li>run the diskmounter script: <code>root@localhost # hdaIDE and SATA hard drives will start with '''ata-''' and USB hard drives will start with '''usb-diskmount</code>'''.<br>Answer "yes" to the prompt to make the drive world writable.</li><li>install pmount if you get an error: <code>root@localhost # yum -y install pmount</code></li><li>try to run the script again: <code>root@localhost # hda-diskmount</code></li><li>reboot</li><li>check Look for your /etc/fstab how the disk is mounted: <code>root@localhost # cat /etc/fstab</code> (it will usually be the last line that's added)hard drive model and serial number. Edit it to where you want to mount it.</li></ul>
=Complete walkthrough=Example:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
[gb@hda ~]$ ls -1 /dev/disk/by-id/ | egrep -v "part|scsi"<br/>
ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V<br/>
ata-ST31000528AS_6VP08W65<br/>
ata-ST3750640A_3QD0LJN8<br/>
ata-ST3750640A_5QD27A57<br/>
ata-WDC_WD10EADS-00L5B1_WD-WCAU4C700358<br/>
usb-ST310003_33AS_9E1CA6FFFFFF-0:0<br/>
usb-ST375064_0A_2009031309E2-0:0
</div>
Your new drive can be configured to mount permanently using the hda-diskmounter script (thanks to Dennis Kaarsemaker and Luigi Capriotti). You can use this for adding a new fixed (internal) disk or an external USB/FireWire disk.==Install prerequisites==
* Make sure you have pmount installed: yum -y install pmount* Execute the script [[Open Terminal as ''root'' and answer YES to the prompt to make the drive writable to all users.* Once complete|In a Terminal, reboot and the secondary drive should automatically mount. * As user ''as root'', edit '''''/etc/fstab''''' to change location of shared ''//hda'' folders to the secondary drive. * To run the diskmounter script, in the directory where the file is located]], do type the followingcommand:
<codediv style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">hdayum -y install pmount fuse fuse-libs ntfs-diskmounter3g gparted</codediv>
This is what ==Partition and format the script added for my hard drive: ''Added by diskmounter utility'' ''/dev/sdb1 /var/hda/files vfat rw,user,fmask=0111,dmask=0000 0 0''
I changed second path to '''''/var/hda/files''''' to enable all shared files This step is optional, and should only be executed if you want to be stored on delete the secondary content of your new hard drive. This is , or if the default path for ''//hda'' file storage systemhard drive has not yet been formatted.
If You should (unless you get something similar like "Disk /dev/dm-0 doesn't contain have a valid good reason not to) use GParted to partition table" and format your hard drive.<br/>From the HDA desktop (or "mount: unknown file system using VNC), [[Open Terminal as root]] and type 'lvm2pv'" its because you have LVM's that gparted''fdisk' can not recognize, (or something like that) its nothing to worry about if you get that when executed launch the hda-diskmounter scriptGParted application.
To know what /dev/sd<x> you need to select in GParted, use the following command, in a Terminal:
<div style=If the script doesn't work for you="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">ls -l /dev/disk/by-id/</div>
These instructions are adapted from [http:Find the row corresponding to your hard drive, and look at the end of the line to identify the correct /dev/wwwsd<x> to select in GParted.mjmwired.net/resources/mjm-fedora-f9.html#ntfs here]
If you're planning to mount a NTFS Example:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@hda ~]$ <strong>ls -l /dev/disk, you'll need to make sure you have ntfs/by-id/</strong><br/>total 0<br/>lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda<br/>lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-3g, fuse and fuse libs all installedHitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../.. If not, login as /sda1<br/>lrwxrwxrwx 1 root and runroot 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb</div>
$ yum install fuse fuse-libs ntfs-3gIn the above example, /dev/sdb would be what I would select in GParted. sda in my primary hard drive, and sdb my second hard drive.
Then use fdisk You probably want to find the disk by running fdisk -l (this is create a lower case L not a 1)single partition, and format it as ''ext3''. You may have <br/>Note that Windows can't read ext3 partitions, so if you want to give read your disk on Windows, you should format as NTFS instead. And you should do that on Windows before you connect the path (drive in your HDA.<br/sbin/fdisk) to make >Remember that using NTFS partitions on Linux will be slower that using ext3 partitions, so you should only use NTFS if you really need it work.
$ There are many easy to follow guides online on how to use GParted. You should Google for one, to find one that seems clear to you.<br/sbin><a href="http:/fdisk /www.mepisguides.com/Mepis-6/Install/gparted/gparted-set-lpartition.html">Here's one</a> that looks simple. Just use ext3 instead of fat32 in you follow that tutorial.
This should return ==Mount the needed information about all your disks. Look out for your newly attached disk. In my case in among the results I can find:hard drive==
Disk /dev/sdb: 120.0GB 120034123776 bytes255 headsA script is provided with Amahi that will look for unmounted partitions in your system, 63 sectors/track.... etc etcand mount any it finds.
I know my disk is 120GB so that's the right one. This tells us the name of [[Open Terminal as root|In a Terminal, as root]], type the new disk which is "sdb" in my case. Running $ sudo /sbin/fdisk -lu /dev/sdb | grep NTFSfollowing command:
<div style="border: 1px solid #A3B1BF; padding: ..will give you a break down of partitions. In my case, there's just one partition, sdb1, so this is the partition I will mount. 5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">hda-diskmount</div>
Now we can go on to create the mount points if needs beExample:<div style="border: 1px solid #A3B1BF; padding: . But because my disk contains all my music, I want it to be 5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[root@hda ~]$ hda-diskmount<br/><nowiki>****************************************************************</nowiki><br/>Ignoring /dev/sda1 - already in /etc/fstab or mounted <br/><nowiki>****************************************************************</nowiki><br/>Mounted /dev/<strong style="color:green">sdb1</strong> as if it were my local '<strong style="Musiccolor:red" folder, so for me the mount point already exists. But if just want to access your disk easily you could just as easily mount it anywhere. Commonly mount points are put in either >/var/hda/mntfiles/ or drives/mediasdb1</. It doesnstrong>'t matter where (read- just be consistent when write)<br/> You may want your system to mount it every time you are doing thisboot. <br/> To do so, add this run these commands as rootline VERY CAREFULLY to /etc/fstab and reboot:<br/> <strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong><br/> $ cd <nowiki>****************************************************************</mntnowiki><br/> $ mkdir my_ntfs_diskAll Linux, Windows and Mac partitions on non-removable disks have been mounted<br/></div>
Substituting my_ntfs_disk for whatever Do '''not''' edit /etc/fstab just yet. What you'll need to add there will depend on how you want to call ituse the extra storage. More about that below.<br/>Just note down the information in bold (green, red and blue). We'll use them below.
Now we can mount the disk in the desired location. Again as root run this command: $ mount If you get something like ''Disk /dev/sdb1 /mnt/my_ntfs_drive dm-0 doesn't ntfscontain a valid partition table'' or ''mount: unknown file system type 'lvm2pv''' its because you have LVM's that 'fdisk' can not recognize (or something similar). It's nothing to worry about if you get that when executing the hda-3g -r -o umask=0222diskmount script.
==Get your partition UUID==Each partition in Linux can be identified with a unique identifier. This command will make identifier, the mounted drive read only. That's great if that's UUID, is what you want, but for me, since I 'll want to save my music there, I need it use to be read and writeablepermanently mount your new partition. For this you'll use:
$ mount /dev/To get the UUID of your new partition, execute this command in a Terminal. Replace <strong style="color:green">sdb1 </mnt/my_ntfs_drive strong> with the (green) value you received from hda-t ntfsdiskmount.<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-3g color: #E6F2FF; margin: 3px 3px 1em 3px;">ls -rw l /dev/disk/by-o umaskuuid/ | grep <strong style=0000"color:green">sdb1</strong></div>
or in my caseExample:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@hda ~]$ <strong>ls -l /dev/disk/by-uuid/ | grep sdb1</strong><br/>lrwxrwxrwx 1 root root 10 2010-02-18 03:24 9d972abc-1639-44df-a60e-668618d40236 -> ../../sdb1</div>
$ mount /dev/sdb1 /home/USERNAME/Music In the example above, my UUID is '''9d972abc-t ntfs1639-3g 44df-rw a60e-o umask=0000668618d40236'''. Note that down.
because I want it mounted in my "Music" file.==Use the hard drive==
Remember in both of these commands you'll need You have a choice here on how to substitute sdb1 with whatever the partition name/number is on use your machinenew hard drive storage space. And in the second command USERNAME is your linux usernameWe'll offer some examples.
===Use the hard drive for all shares===If you now go want all your shares to be on your desktop, you should see the new hard drive is mounted there. Click on it to see the contents are there. If you've mounted it as say So far so good? Ok, lethere's continuehow to do that.
What First, you've achieved so far is ll need to move all you shares data into your new drive.<br/>[[Open Terminal as root|In a temporary mounting of Terminal, as root]], type the drive/partitionfollowing command. That shows it can be done but Replace the path in red with the path you'll need to make it permanent otherwise received when you reboot itran hda-diskmount.<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mv /var/hda/files/* <strong style="color:red">/var/hda/files/drives/sdb1/</strong></div>You'll disappear again. For this you need get a warning about "cannot move `/var/hda/files/drives' to edit fstab with your favourite text editora subdirectory of itself"; that is fine, ignore that. As root run:
$ gedit Next, you'll need to unmount your new hard drive, and remount it as /etcvar/fstabhda/files
A text editor window will pop up<div style="border: 1px solid #A3B1BF; padding: . Enter this on the last line5em 1em; color: #000; background-color: #E6F2FF; margin:3px 3px 1em 3px;">umount /var/hda/files/drives/sdb1/</div>
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">nano /devetc/sdb1 fstab</mnt/my_ntfs_drive ntfs-3g ro,defaults,umask=0222 0 0div>
* In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount gave you (the blue one), and change the first two values.<br/>Instead of /dev/sdb1, enter '''ro to rwUUID=''' and followed by the UUID you found earlier.<br/>Replace the second value with '''umask=0222 to umask=0000/var/hda/files''' if you want it to be writable.
You'll need to do this for every partition, so if you have several partitions on sdb, the last lines of you fstab may look something like thishda-diskmount gave me:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong></div>
/dev/sdb1 /mnt/my_ntfs_drive_C ntfsSo I should add this instead:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-3g ro,defaults,umaskcolor: #E6F2FF; margin: 3px 3px 1em 3px;"><strong>UUID=0222 0 09d972abc-1639-44df-a60e-668618d40236</strong> <strong>/devvar/sdb2 hda/mntfiles</my_ntfs_drive_D ntfs-3g ro,strong> ext4 defaults,umask=0222 0 01 2</dev/sdb3 /mnt/my_ntfs_drive_E ntfs-3g ro,defaults,umask=0222 0 0div>
When Make sure you reboot, do '''not''' change anything else from the blue line you should find your data where received from hda-diskmount.<br/>It might not be the same thing as the above example; oyu need to use the values you want it've received.
= Guide to Adding a Hard Drive to Fedora =Save and exit nano (CTRL-X), and try your new mount:
This is <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mount -a good guide, for advanced users, to adding a hard drive to Fedora:</div>
http://fedoranewsThat's it.orgAll your shares in /tchungvar/storagehda/files are now on your new hard drive.
And a good fedora 9 guide here, including a section ===Use the hard drive for only some shares===If you want only some of your shares to be on adding a your new hard drive , here:'s how to do that.
httpFirst, you'll need to move your shares data, if any, into your new drive.<br/>[[Open Terminal as root|In a Terminal, as root]], type the following command. Replace the path in red with the path you received when you ran hda-diskmount. Replace '''something''' with the name of the share you want to have on your new drive (the share should already exists).<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color:#E6F2FF; margin: 3px 3px 1em 3px;">mv /var/www.mjmwired.nethda/files/<strong>something</strong> <strong style="color:red">/var/hda/files/drives/sdb1/</resourcesstrong></mjm-fedora-f9.htmldiv>
=Partitioning a Brand New Disk=Repeat with every share you want on your new drive.
If you have a blank, unpartitioned, driveNext, you have 'll need to 1) partition it and 2) format it.make the mount permanent
If you want to move this disk to windows machines, you may want to format it as NTFS. To do this, it's best if you do that in Windows<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">umount /var/hda/files/drives/sdb1<br/>nano /etc/fstab</div>
In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount gave you (the blue one), and change the first value only.<br/>
Instead of /dev/sdb1, enter '''UUID=''' followed by the UUID you found earlier.
To make a partitionIn nano, ityou's best ll need to use add a new line at the bottom. Take the line that hda-diskmount gave you (the blue one), and add it as root)-is:
gpartedhda-diskmount gave me:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong></div>
in So I should add this: <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong>UUID=9d972abc-1639-44df-a60e-668618d40236</strong> /var/hda/files/drives/sdb1 ext4 defaults 1 2</div> Save and exit nano (CTRL-X), and try your fedora desktop, as new mount: <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mount -a</div> That's it'. Your share(s graphical and will help make decisions) are now on your new hard drive.