Now some of you will write in no doubt and say how easy this is – how could I possibly not know this. Well, I didn’t. I found out two other things this week – so here’s the lot in one go.
SD Card Cloning
But before I start, here’s something else I just cleared up – cloning of microSD cards. I was SURE I read there was an issue cloning the Pi SD cards. So having set up my Pi2 the way I wanted it with just about everything but the kitchen sink in it, I decided to start the second Pi2 from scratch – well that didn’t work out because about 2.3rds the way through setting up the many programs, the think ground just about to a halt – I mean like 5 minutes to power up. Was it the microSD?, was it the Pi? was it the setup? I decided I had nothing to lose by cloning the microSD with Windows 8.1 using Win32DiskManager.
So that I did and sure enough – I now have two fully functioning Pi2 boards, one on 192.168.0.15 and the other on 192.168.0.6 – oh and that includes WIFI – I just plugged an identical WIFI module into the second Pi, powered it up and it just worked.
SD Card Lifetime
Something ELSE I just discovered. So I was getting worried about the lifetime of the microSD given that I’m using mySQL for example which surely must hammer the disk. WELL, it turns out that as well as looking for memory cards with SPEED you need to consider automatic levelling. EH? Don’t worry you don’t have to do anything. So imagine the Pi is writing to the card over and over in the same spot. Well, you only get 10s of thousands of writes and depending what you’re doing that could be wrapped up in weeks never mind years. It turns out that SD cards with automatic levelling (Samsung Ultra comes to mind as against cheap unbranded crap) actually have a controller in there that monitor usage and move stuff around for you!! The downside is that there’s always the possibility you finish what you’re doing, shut off and.. lose some data – so – shut the Pi down properly and use some kind of uninterruptable supply. SOME phone chargers will act like an uninterruptable, some won’t… you’ll have to take pot luck on that, I have 4 different battery packs (JuiceBar etc) and only two of them make reliable uninterruptable power supplies.
Remote Access to Pi Files
and so finally onto remote access…. up to now I’m using WinSCP on the PC talking to TightVNCServer on the Pi2 boards.. but could never get past user pi level access – in other words it I typed in root and a password, no matter what password it would not work. I could have SWORN I had typed in a root password.. however, obviously not.
So off I went to the web to find out how to fix that, most of the instructions said “just enable a root access password and you can then log in using WinSCP as root”. HAH, all very nice but how the hell do you do THAT?
Turns out it’s easy… open a terminal in the Pi (unless you’re already in command line mode) – and type…
sudo passwd root
at which point you get asked for a password twice and Bob’s your uncle!! So now I can access the Pi files from my PC from either device – as Pi or Root as easy as clicking a couple of buttons.