zilexa

2. Static Mount an HDD in XBian/Debian (optional)

Jul 15th, 2013
3,176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. Mounting your USB harddrive in XBian/Debian
  2. ===========================================
  3. WHEN DO YOU NEED THIS?
  4. XBian already mounts the drive for you. But it uses the /dev/sda or /dev/sdb naming scheme. If you add more drives/usb sticks and definitely when you occasionally disconnect the drive (perhaps to connect it directly to your Mac of Windows), next time you connect it, it can have a different letter, so suddenly your Movies won't be in /media/usb but in /media/usb1.
  5. A better solution would be to mount using a universal naming scheme: using a unique ID of the harddrive: UUID. This way, the mounted folder will always be the same. This is called a static mount. Only if you want to create a *static* mount, you can perform this single step.
  6.  
  7. 1. Create a folder that will be used to mount your harddrive permanently. First check your /media folder:
  8. type: cd /media
  9. now you are in the /media folder
  10. type: ls
  11. this will list all shortcuts that have been created. delete usb0 and or usb simply by:
  12. sudo rm usb0
  13. Then you can create an actual folder that will be used to mount the harddrive permanently:
  14. sudo mkdir /media/usb
  15.  
  16.  
  17. 2. Add this line to /etc/fstab. (connect via SSH, exit XBian-Config, then type sudo nano /etc/fstab)
  18. For EXT4 drive, add this line to the bottom:
  19. UUID=c4669834-e790-4f7a-83b4-2ac0d8588bf3 /media/usb0 ext4 defaults,noatime 0 0
  20.  
  21. For EXFAT (recommended if you want to connect the drive to Mac or Windows later) or NTFS add this line to the bottom:
  22. UUID=643C03443C0310AA /media/usb0 ntfs-3g defaults,noatime,nodiratime,async,big_writes 0 0
  23.  
  24. NOTE A: change the UUID in the examples above to the UUID of your harddisk!
  25. NOTE B: Harddisk will be mounted to /media/usb0 and by default media/usb will link to this folder. Change this if necessary for your own setup.
  26.  
  27. HELP:
  28. How to find your UUID?
  29. Run these 2 commands, Then you should be able to know what UUID belongs to the drive you want to mount.
  30.  
  31. This shows all disks (including the partitions on the SD card) by UUID:
  32. ls -l /dev/disk/by-uuid/
  33.  
  34. And this simply shows the disk and its current details.
  35. fdisk -l
Advertisement
Add Comment
Please, Sign In to add comment