1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Open Source I want to take my NAS to the next level

Discussion in 'Software' started by Cleggmeister, 7 Jan 2016.

  1. deathtaker27

    deathtaker27 #noob

    Joined:
    17 Apr 2010
    Posts:
    2,102
    Likes Received:
    128
    try right click to paste ;)
     
  2. phuzz

    phuzz This is a title

    Joined:
    28 May 2004
    Posts:
    1,703
    Likes Received:
    24
    By default paste is right-click in putty. To copy in putty, just select the text, it'll auto copy to the clipboard.
    I never knew that about mounting UIDS, thanks Gareth!
     
  3. Gareth Halfacree

    Gareth Halfacree WIIGII! Staff Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    13,196
    Likes Received:
    2,288
    You certainly can. A neater way than using the /dev/disk/by-label/Music path, though, is to use the LABEL option in fstab:

    LABEL=Music

    Labels, while pretty, aren't as 'safe' as UUIDs, though: if you plug another drive with the label Music in, Interesting Things will happen.

    No need to edit the permissions if all you are doing is deleting it:

    sudo rm -rf /media/Music/leftoverplexcrap

    WARNING: the -rf switch to rm means "recurse subdirectories and force deletion," while "sudo" means "run this command as a different user (and without specifiying the user, as root.)" If you fat-finger the path, it will delete everything from the directory you specified downwards. For example, accidentally typing the following:
    sudo rm -rf /media/Music /leftoverplexcrap

    Will result in you deleting the entire contents of your Music drive. Accidentally typing this:
    sudo rm -rf / media/Music/leftoverplexcrap

    Will result in you deleting everything from all currently mounted drives. So, y'know, don't do it. If you want to be sure, replace "f" with "i" to be asked if you really, really want to delete each file, or "I" to be asked if you want to delete groups of three or more files. So, try:

    sudo rm -rI /media/Music/leftoverplexcrap

    Oh, and a couple of little pro-tips for managing you server more easily. First, have you ever typed a command (like apt-get) without sudo and been given an error? Annoying, isn't it? Sure, you can hit the up-arrow to go back to the last command, home to go to the front of the line, and type "sudo " before hitting enter again - or you can do this:

    sudo !!

    That will run your last command, but with sudo. Handy!

    Remember typing out a long command a while back, but not sure where in your bash history it sits? Don't fancy pressing up a thousand times to find it? Press Control + R, then type whatever part of the command you can remember: bash will search through its command history for matches. Hit Control + R again to search further back if the first hit isn't the one you're after.

    Got a long-running foreground process, like copying masses of files from one place to another? You may have noticed that when you disconnect from SSH, the process is killed. Annoying having to keep your desktop switched on and connected while the server's doing something, isn't it? Run the command with "screen" - so, for the copy example, it might be:

    screen cp -r /media/Music/* /media/NewMusicDrive/

    Everything'll look pretty normal, but if SSH gets disconnected the process will continue running. You can also cleanly disconnect the process from the controlling terminal with Control + A, followed by a lowercase D. This lets you get on with something else while the process runs in the background. When you want to pick it up again, either because you disconnected it yourself or your SSH session was interrupted, just type:

    screen -r

    If there is more than one active screen session, you'll be prompted. Use labels - see "man screen" for details - to make it clear which process you're running in which screen session.

    Finally, if you're thinking about opening SSH to the world so you can fiddle with your server remotely, you'll want to disable root login via SSH, disable password login, set up a public/private key-pair for each of your client systems, and install fail2ban (sudo apt-get install fail2ban) to keep things secure.

    Enjoy!
     
  4. Cleggmeister

    Cleggmeister Of reasonable knowledge...

    Joined:
    12 Oct 2009
    Posts:
    1,140
    Likes Received:
    22
    Many thanks Gareth, I feel particularly well-armed now! Server coming along nicely - just not at the pace I'd hoped (reverted back to OMV just now so that my daughter can watch My Little Pony episodes while daddy "fixes the computer")!

    I might buy another Microserver actually. Hmmmmm :)
     
  5. theshadow2001

    theshadow2001 [DELETE] means [DELETE]

    Joined:
    3 May 2012
    Posts:
    5,170
    Likes Received:
    146
    Using the tab key to autogenerate the paths as you type the command helps not rm -rf from the root directory out. It also makes navigation easier as well.
     
  6. Cleggmeister

    Cleggmeister Of reasonable knowledge...

    Joined:
    12 Oct 2009
    Posts:
    1,140
    Likes Received:
    22
    Friends, I don't know what to say (and I don't want to disappoint you) but I've bailed on the whole idea and switched back to OpenMediaVault for now. The support on this thread has been fantastic and I will revisit the project at a later date, however for now I'm too short of time and too scared to do things properly!

    Feel like a bit of a wuss but I'll maybe tackle this again when the kids have grown up and moved out. Only 20 years or so to wait... :)

    Back to OMV and I'll try and figure out some of the more complex plugins (or tackle packages direct from the CLI).

    Thanks again for wonderful help and suggestions!

    Cleggy.
     
  7. Gareth Halfacree

    Gareth Halfacree WIIGII! Staff Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    13,196
    Likes Received:
    2,288
    Set up a virtual machine on your desktop, install Ubuntu Server, play around to your heart's content until you feel confident enough to do the same on real metal. Bonus: snapshots to easily undo something you did wrong and try again.
     
  8. Cleggmeister

    Cleggmeister Of reasonable knowledge...

    Joined:
    12 Oct 2009
    Posts:
    1,140
    Likes Received:
    22
    Splendid idea, many thanks Gareth. I've installed Virtualbox and a Ubuntu Server vdi. Will tinker once I've finished mucking about with my little RAID project... :)

    Thanks again.

    Cleggy.
     
  9. badders

    badders Neuken in de Keuken

    Joined:
    4 Dec 2007
    Posts:
    2,635
    Likes Received:
    72
    Bonus points for, once you've finished tinkering in a VM, dd'ing the VDI to a physical disk and then bunging that in the server...
     

Share This Page