News for hackers. Stuff that matters.
Re:Turn your old, cracked Android phone into a backup server by notjulianjaynes on Monday June 21, 2021 @02:01AM (#27576703)
Root required, darn. I have 2 or 3 android phones with bad screens sitting in a drawer I'd like to do something with. Unfortunately they a.) don't have USB debugging enabled and b.) don't support any sort of external display.

If anyone had some tips on how I could get into these machines it would be much appreciated.

Re:Turn your old, cracked Android phone into a backup server by dehrmann on Monday June 21, 2021 @02:16AM (#27576758)
You're better off getting a single-board computer for this. You'll be able to install your own mSATA drive, and it'll run most distros without any fuss. That said, this quickly escalates to just set up a real NAS box. You don't really want to use an SSD for backup because they can lose data when not used. Alternatively, just go with a cloud provider.
Re:Turn your old, cracked Android phone into a backup server by KronisLV on Monday June 21, 2021 @04:06AM (#27577223)
As funnny as this is, i never really go the whole concept of a "real NAS box" - do people usually mean specialized hardware in combination with something like the FreeNAS OS?

Because right now i'm just using consumer hardware (an Athlon 200GE for its low 35W TDP, some cheapo RAM and a number of Seagate BarraCuda HDDs) in combination with Debian, which also runs on my other cloud servers. It's all mounted on my other devices either through SFTP or a Nextcloud instance that's also running on them for easier file replication. I don't even have RAID or ZFS/XFS/Btrfs file systems, just ext4 because any sort of clustering would introduce unneeded complexity to the setup - instead, a cron job with rsync backs the data from the "primary" HDDs to "secondary" ones every day in an incremental manner (well there's also BackupPC that does network rsync backups across servers).

What purpose would running a NAS oriented OS distro even serve, for simple uses cases like that? It feels like the current "ad hoc" setup is really affordable and easy to operate.

I think a SoC would also be nicely suited for this, as long as there is sufficient I/O capability. In regards to phones, however, i feel like drivers for obscure devices could probably become problematic quickly.

Re:Turn your old, cracked Android phone into a backup server by neartheplain on Monday June 21, 2021 @05:10AM (#27577506)
To me, a real NAS box means:

- ECC RAM, to avoid corruption on write

- Software RAID, to avoid data loss due to drive failure

- Some kind of checksumming and error-correcting filesystem, e.g. ZFS, to prevent data loss due to bad sectors

- Enough CPU to transcode media in real-time

- Vanilla distro with SSH, SMB filesharing, Plex, and networked printing

- A spare PSU in the closet

I explicitly avoid:

- Hardware RAID (unnecessary, expensive, harder to fix)

- Any OEM prebuilt NAS products (more expensive, less capable, less user control)

- Any specialty NAS-oriented distros or OSes (more feature bloat, bigger attack surfaces)

I use plain old Debian for my home NAS. I'd switch to OpenBSD in a heartbeat if it supported a checksumming and error-correcting filesystem.

Re:Turn your old, cracked Android phone into a backup server by nottorp on Monday June 21, 2021 @06:12AM (#27577789)
> Software RAID, to avoid data loss due to drive failure

Ok it's old but: raid is not backup.

I've personally worked for a small online shop that was selling digital items and shut down when their raid failed. Of course, they had ignored my warnings to build a mirror system or do copies on removable drives or ... anything resembling an actual backup.

Edit: that said, I do have a box that's pretty similar to what you're describing.

Re:Turn your old, cracked Android phone into a backup server by neartheplain on Monday June 21, 2021 @06:50AM (#27577968)
Yes, for actual backups I have M-DISC BluRays [0] which I keep in a fireproof box. They're limited in capacity compared to the full NAS, but big enough for really important stuff like photos and scanned documents (which conveniently are intrinsically write-once).

[0] https://en.wikipedia.org/wiki/M-DISC

Re:Turn your old, cracked Android phone into a backup server by khimaros on Monday June 21, 2021 @08:17AM (#27578417)
encrypted, deduplicated offsite backups are another approach. borgbackup on free tier cloud services can be useful for this.
Re:Turn your old, cracked Android phone into a backup server by syntheticnature on Monday June 21, 2021 @09:10AM (#27578775)
Serious question: are there free tier cloud services with enough storage to be worthwhile?
Re:Turn your old, cracked Android phone into a backup server by justin_oaks on Monday June 21, 2021 @11:20AM (#27580035)
It probably depends on how much you need to store. But if you need ongoing backup that will get larger and larger then the answer is probably "No".

I back up my family photos and other important files to Amazon S3 using Restic. My 150GB of data ends up costing me about $1.50/month. I could get the price down lower if I use, say, the Infrequent Access storage tier, but at that price point I just can't be bothered to deal with it.

A free tier often isn't worth it if you have to put any time into thinking about whether you'll exceed the limit. I'd just go with a cheap pay-as-you-go service and not worry about it.

Re:Turn your old, cracked Android phone into a backup server by Miraste on Monday June 21, 2021 @10:53AM (#27579748)
> Any specialty NAS-oriented distros or OSes (more feature bloat, bigger attack surfaces)

So you recommend ZFS but not TrueNAS? It more or less is FreeBSD with zfs and NAS-oriented defaults+utils. There's not much I'd count as bloat.

Re:Turn your old, cracked Android phone into a backup server by makeitdouble on Monday June 21, 2021 @04:57AM (#27577453)
To me choosing a specialized hardware was motivated by these two factors:

- power management

- semi-closed source applications

On power management, I don't use the NAS box continuously, and there can be long gaps between accesses. Having the box "sleep" for 95% of the day, and wake up the disks only for one or two bursts of activity is interesting to me.

I tried doing that with DIY solutions, including Raspberry Pi+SATA disk type of arrangements. Overall it didn't work great and was a PITA.

On the semi-proprietary apps, I am thinking about Synology's apps. I could totally live without them, but it's a nice addition to the package, they're easy to install, seem to be well maintained and work decently well.

Re:Turn your old, cracked Android phone into a backup server by rob74 on Monday June 21, 2021 @06:14AM (#27577800)
> Having the box "sleep" for 95% of the day, and wake up the disks only for one or two bursts of activity is interesting to me.

Have you really managed to get that to work? I got a QNAP TS-230 a few months ago hoping I could do just that, but it turns out that even this smallest NAS box they are offering isn't really designed with this "occasional use" in mind. There are so many user questions about this (https://www.qnap.com/en-us/how-to/faq/article/why-are-my-nas...) that they even built a half-baked utility that's supposed to give you a hint which process is preventing the drives from going into sleep mode, but it's not a great help. I have disabled all services (photo indexing with face recognition and other such crap) except for the most basic ones, but still the drives are happily chugging along, flashing their LED every few minutes, not spinning down. I know that it's basically a Linux computer, and there are probably utilities I can install to diagnose the issue better than with the above-mentioned software, but isn't this something that's supposed to work out of the box, or at least be easy for an average user to accomplish?!

Re:Turn your old, cracked Android phone into a backup server by makeitdouble on Monday June 21, 2021 @11:42AM (#27580265)
I have an old Synology, so it miht be different.

I run relatively few stuff on it too, with no client that consistently access the shares though samba/nfs (I cluster the scripts that run automaticaly around the same range of time, and they unmount after they’re done).

I wonder if your system is not writing logs from a monitoring service (something checking your dynamic DNS, or waiting for remote connections, or pinging the internal servers to see if they’re alive).

I stopped most default services, including sync (it’s done more rarely via a user script instead), and yes, it can be a PITA to understand what’s running out of the box.

Re:Turn your old, cracked Android phone into a backup server by dkarp on Monday June 21, 2021 @06:03AM (#27577748)
As someone who normally rolls their own and has a half dozen raspberry pis around the house, I have a Synology NAS.

As you said, it's very low energy and zero noise (rubber feet and quiet fan).

It's also effortless to set up and run with their RAID system and syncing etc is very good. It'll let me know if there is a problem with a drive, it keeps itself updated and I've never had to reboot it.

I do not use it for Plex as it wouldn't be able to handle it. They are a bit under powered but they're very optimised for their main purpose, Network Attached Storage, and that's the most important thing for me.

It is also very neat and tidy, unlike most home made solutions.

Re:Turn your old, cracked Android phone into a backup server by NortySpock on Monday June 21, 2021 @11:19AM (#27580019)
Would OpenMediaVault on a Raspberry Pi have met your RAID and sync needs?

I keep eyeing OMV but haven't splurged on running a NAS with multiply-redundant drives separate from my application server; currently it's just an RPi4 as a docker host, with rsync keeping two USB drives in sync with each other.

Re:Turn your old, cracked Android phone into a backup server by makeitdouble on Monday June 21, 2021 @11:31AM (#27580148)
I’m obviously not very good at this, but my issue with OpenMediaVault was less the software side than finding hardware to reliably work with it.

For instance trying with an old low profile PC, wake on lan didn’t work half of the time so I gave up, and just let the drives sleep. But they would also fail to wake up sometimes.

All in all a NAS is not that expensive (I have one I bought for 400 or so, and it’s lasting for 15 years now…), so it’s hard to justify the endless tweaking of a solution that could work the same if done well.

BTW even with a commercial NAS , ssh access is configurable, major scripting languages are there, and recent ones have docker I think. For the really custom stuff, like you I use Raspberry Pis that mount the NAS files as needed.

Re:Turn your old, cracked Android phone into a backup server by dkarp on Monday June 21, 2021 @01:56PM (#27581735)
Probably, at least on the software side!

But then I'd need to find a RAID enclosure and a something to run OMV on. The NAS was around £150 with all that built in

Re:Turn your old, cracked Android phone into a backup server by hansel_der on Monday June 21, 2021 @06:55AM (#27577991)
yea, normies do just buy a ready-built nas appliance, if you know what you are doing or like to tinker, use old consumer hardware.

just one nitpick with your setup:

if your primary hdd corrupts, rsync will not notice/care and corrupt your backup as well. zfs is all the rage because it aims to have two sources for the data aswell as a checksum, so it can tell which data-source is flawed AND fix it.

Re:Turn your old, cracked Android phone into a backup server by KronisLV on Monday June 21, 2021 @01:17PM (#27581255)
Oh, another person also mentioned using ECC memory, which may not be awfully important until it suddenly is.

Right now i have incremental backups over the network with BackupPC: https://backuppc.github.io/backuppc/

That software solution sort of dances around the issue, because if any files were to become corrupted, i could just go back in time to their older versions, though that approach isn't necessarily good either - since that means having to store the original "full" backups for a long time and also takes up more storage, which i do for the essential data, but not the stuff that i'm willing to lose. And, since the data stored can be arbitrary and therefore checking for corruption would have to be done manually, there are serious drawbacks to that, in regards to even knowing when things have gone wrong.

Of course, there's also the possibility to use additional sources of redundancy, like versions within Nextcloud should the actual file contents of a particular version become corrupt, however for certain scenarios file systems like you've described indeed do become the way to go. Maybe not for every homelab out there, though.

Re:Turn your old, cracked Android phone into a backup server by hansel_der on Saturday June 26, 2021 @03:47AM (#27639991)
yea, error correcting memory is a second step towards data integrity. but it is of little use if your at-rest storage has no means to detect errors (like normal filesystem or raid1).
Re:Turn your old, cracked Android phone into a backup server by pjmlp on Monday June 21, 2021 @04:48AM (#27577405)
Regular people usually buy something like a Western Digital NAS from the shopping mall on the neighbourhood.
Re:Turn your old, cracked Android phone into a backup server by poisonborz on Monday June 21, 2021 @04:10AM (#27577241)
> You don't really want to use an SSD for backup because they can lose data when not used

Not (really) true, there is not much hard data backing this up as I see it, and for what there is, the retention would be 1+ year. The thread is not about offline backups, but an always powered backup server anyway. And SSD does make sense for a lot of reasons: HDD speeds are likely slower than local CAT cable, the higher IOPS helps on parallel workload cases, not to mention the way lower power draw and zero noise (no moving parts for the rest of the setup), compared to a chirping HDD.

Re:Turn your old, cracked Android phone into a backup server by hungryforcodes on Monday June 21, 2021 @03:27AM (#27577069)
Obviously solid advice, but I think the point here is about reusing old electronics. I also have a couple of old phones I'd like to try this with.
Re:Turn your old, cracked Android phone into a backup server by Aulig on Monday June 21, 2021 @03:51AM (#27577162)
Not sure if it helps you to get root, but to enable debugging you could use something like this guide: https://www.youtube.com/watch?v=GPJcR_Iosm4

Once you have usb debugging, I can recommend Vysor, super easy to use to control your phone from the pc.

I'd also recommend turning on Talkback (assistive technology) and VoiceAccess as that can help you use the device even if you cant see anything on your screen. That helped me a lot with my phone that has a broken screen where nothing but the touchscreen works.

Re:Turn your old, cracked Android phone into a backup server by khimaros on Monday June 21, 2021 @08:19AM (#27578435)
also scrcpy
Re:Turn your old, cracked Android phone into a backup server by ce4 on Monday June 21, 2021 @02:37AM (#27576863)
You could order replacement screens and try to fix it yourself. Depending on the model it's often cheaply available on Aliexpress or ebay.
Re:Turn your old, cracked Android phone into a backup server by HPsquared on Monday June 21, 2021 @06:32AM (#27577879)
Look up Termux, it doesn't require root.
Re:Turn your old, cracked Android phone into a backup server by rjzzleep on Monday June 21, 2021 @03:35AM (#27577101)
I have a rooted phone that I use to get information I need root for with a broken touchscreen. The other day I was stupid enough to try to reset it to see if I could part of the screen working. Obviously that didn't work.

Re-enabling USB debugging was the following process:

1. use USB-OTG to go into the bluetooth menu to connect a bluetooth device to.

2. enable usb debugging using mouse

3. connect to PC and use the bluetooth keyboard to allow USB debugging

4. use scrcpy to control the device

Obviously this only works reasonably well if you can see at least some portion of the screen.

Re:Turn your old, cracked Android phone into a backup server by sippeangelo on Monday June 21, 2021 @04:22AM (#27577298)
It also only works if your phone is on an old enough Android version where they haven't put OTG behind a manual toggle yet.
Re:Turn your old, cracked Android phone into a backup server by yjftsjthsd-h on Monday June 21, 2021 @11:15AM (#27579976)
What versions of Android have a toggle to allow USB OTG?
Re:Turn your old, cracked Android phone into a backup server by BelenusMordred on Monday June 21, 2021 @02:07AM (#27576717)
Not sure about this guide but you should be able to install a linux rom through fastboot instead of a recovery. You won't need a working screen to do that.
Re:Turn your old, cracked Android phone into a backup server by jamexcb on Tuesday June 22, 2021 @06:42AM (#27590020)
I had a similar problem. But I could see part of the screen. So o used a usb OTG cable with a mouse to enable BT and connect a second mouse using BT. Then I was able to enable USB debugging to use with scrcpy. Now I use the phone as a "security" cam.
Re:Turn your old, cracked Android phone into a backup server by MayeulC on Monday June 21, 2021 @02:53PM (#27582608)
If they have their bootloaders unlocked, I'd look into postmarketos. If not... well, I guess you really need to fix the screen up first, unless you had enabled adb. It could even be a temporary fix (for instance, a single screen if the 3 devices are the same.
Re:Turn your old, cracked Android phone into a backup server by butz on Monday June 21, 2021 @02:56AM (#27576935)
Depending on device you have, you might be able to build a serial cable for it: https://wiki.postmarketos.org/wiki/Serial_debugging
Re:Turn your old, cracked Android phone into a backup server by rawbot on Monday June 21, 2021 @03:20AM (#27577032)
Depending on how broken the screen is, you could navigate Android with a USB keyboard/mouse.