4 ms·
the only answer i’d use here is “go buy another 1TB drive and then ...” $100 and a day and a half for shipping is a much better idea than playing russian roule
by hprotagonist 6y ago
the only answer i’d use here is “go buy another 1TB drive and then ...”
$100 and a day and a half for shipping is a much better idea than playing russian roulette with work data by adjusting files in-place.
- help56883 6y agoYeah that's right. Even 2 TB drives don't cost $100 though.
- hprotagonist 6y agoSamsung 850 EVO 250GB 2.5-Inch SATA III Internal SSD (MZ-75E250B/AM) https://www.amazon.com/dp/B00OAJ412U/ref=cm_sw_r_cp_api_fab_JaGAFbHSEVABQ https://www.amazon.com/dp/B00OAJ412U/ref=cm_sw_r_cp_api_fab_... Ok, $110.
- hervature 6y agoParent is agreeing with you. 2TB drives do not cost $100. https://www.amazon.com/Seagate-BarraCuda-Internal-Drive-3-5-Inch/dp/B07H2RR55Q/ref=sr_1_3?crid=1XOSDB8OH2C9M&dchild=1&keywords=2tb+hard+drive&qid=1600783165&s=electronics&sprefix=2tb%2Celectronics%2C205&sr=1-3 https://www.amazon.com/Seagate-BarraCuda-Internal-Drive-3-5-...
- hprotagonist 6y agoah damn platters are cheap! i forgot about not-SSD for a second there.
- silon42 6y agoI'd use the answer 2 (but attempt to just compress the output first, depending on type of data, leaving original file alone)
- abhayhegde 6y agoThat is a nice approach, I agree. But from next time it is better to use the name of the answerer or link rather than saying 1st or 2nd answer since the position may change anytime depending on upvotes.
- _mkef 6y agoAgreed. I can't imagine unless s/he wants to accidentally lose the data any better alternative. Even if this works perfectly, you never want to delete data you can't easily retrieve again. Next Monday the client might change their mind
- Demiurge 6y agoVery recently I've been in a similar situation with a dedicated server. There was no way to add storage and even getting another server would have been pretty expensive. Luckily it was a raid, so I just had to double the storage temporarily :)
- speedgoose 6y agoI guess you weren't allowed to use a public cloud provider. Because you can always mount a network file system using sshfs, s3 like, or similar. Or upload the file on another server rented for one hour.
- Demiurge 6y agoI guess I could have asked for the CC information, setup a new AWS account, and have them pay for the storage and egress of 1.5TB of data. However, that very likely would have lasted quite a while as well, and in my case I had to minimize downtime as well. So, no, I would say even if you're allowed to do something, sometimes it is not the best solution.
- nybble41 6y ago> playing russian roulette with work data by adjusting files in-place That can be avoided if your filesystem supports reflinks / copy_file_range (BTRFS, XFS, OCFS2). Just create a reflink of the file, drop all the blocks at the beginning of the reflink "copy" up to the one containing the line you want to start with using fallocate --collapse-range, and overwrite the remaining data up to the first line with some suitable fill character. For the JSON-encoded lines in this case spaces should work. Total disk space used: one data block for the padding plus some metadata for the reflink. No changes to the original file. No copying or relocating 700 GB of data. Quick, easy, and and safe. But you have to start with the right filesystem for it to work.
- zeroimpl 6y agoIt’s not like you can’t test your script on another file first. If it works fine on a 1GB file with 300K lines, why wouldn’t it then work on the real file? What would you do when the next time this happens it’s 300B lines from a 1PB file?
- fomine3 6y agoBackup is important even if you're confident.