Friday, August 1, 2014

filesystems - How to read ext4 partitions on Windows?

Is there a way to read ext4 partitions from Windows? If so, what can I do?

windows 10 - My PC does not sleep, hibernate, or shutdown properly


I´ve been struggling with this problem for a while now, when I command my computer to shutdown, sleep or hibernate it does not. I´ve tried: Updating windows, updating drivers, changing power plans. All failures.


Now I will show my event log, I do not fully understand it, so if anyone could help me find the problem I will appreciate that. I put it upside down for clarity.


LOGS:



Information 1/03/2019 8:00:46 a. m. Kernel-Power 187 (243)


The user mode process attempted to change the state of the system by
calling the SetSuspendState or SetSystemPowerState APIs.


Information 1/03/2019 8:00:52 a. m. Kernel-Power 42 (64)


The system is going into suspension. Reason for suspension:
Application API


Information 1/03/2019 8:00:54 a. m. Kernel-Power 107 (102)


The system resumed from the suspended state.


Error 1/03/2019 8:00:54 a. m. Kernel-Power 137 None


The system firmware changed the registers of the processor memory type
range (MTRR) during a suspension state transition (S5). This can
reduce the performance of the resume.



I believe the last error is when I force shutdown my PC, basically I select hibernation and then when the PC does not reduce the power (only monitor is turn off) I force shutdown, in this way I am able to pick it up how I left it. Any question or if you required more information just let me know.


OS: Win10 pro 1809
Mobo: Asrock H310


Answer



The problem was fixed by accident. I upgraded my RAM, so I unplogged the computer, when I hibernate it again it did it succesfully, so whatever is was, was not stopped by forcing shutdown, but when unplogged. Thanks for your answers, I hope this works for anyone else with this problem.


How to change boot option and set the USB as first boot option

I am configuring my laptop ASUS A53SC with a Dual-Boot System, I already have windows intalled, and I want to install linux from my USB stick but booting from USB is not configured, and I can't add new boot option in the BIOS.
My Laptop is a ASUS A53SC running windows 7 64 bits. I cant post an image of my BIOS boot menu, but it is like this.


BOOT CONFIGURATION


UEFI Boot ........................................................................................................................... [DISABLE]
PXE ROM............................................................................................................................ [DISABLE]


Boot Option Priorities


Boot Option #1 .....................................................................................................[P0:Hitachi HTS547..]


Boot Option #2 ................................................................................................[P1:MATSHITADVD-RA..]


Hard Drive BBS Priorities


CD/DVD ROM DRIVE BBS Priorities


Delete Boot Option

windows - Cannot Delete Item "Could Not Find This Item" issue

A friend sent a long a file (a .rar) he wanted me to check out for him before he installed it.


I downloaded it and unrared it with no problems, but it was full of .exe's instead of the intended contents (fonts) so I advised him to delete it immediately and not use.


I then proceeded to do the same, but the folder simply will not delete. Oddly the files went fine, and I never ran anything, but this is what I'm seeing:


Could not find this item
This is no longer located in C:\Users\This_User\Desktop. verify the item's
location and try again.

I've tried the following things with no help:



  • Using "Unlocker" to Unlock and delete

  • Using move on reboot and rebooting

  • Using PendMoves (from sysinternals) and rebooting Elevating a cmd line, doing a dir /x to get the short name of the folder, and then del 'shortna~1'

  • Moving the folder to a new folder and then trying to delete the parent folder


I'm on Windows 7 RTM, very fresh install. Any thoughts?


Update: Just to confirm, I've run Hijack this and half a dozen other malware detectors, and everything came back clean (no extra processes, no other obvious badness). Rebooting in safe mode didn't help either.

security - How to securely delete files stored on a SSD?


From a (very long, but definitely worth to read) article on SSDs:



When you delete a file in your OS, there is no reaction from either a hard drive or SSD. It isn’t until you overwrite the sector (on a hard drive) or page (on a SSD) that you actually lose the data. File recovery programs use this property to their advantage and that’s how they help you recover deleted files.


The key distinction between HDDs and SSDs however is what happens when you overwrite a file. While a HDD can simply write the new data to the same sector, a SSD will allocate a new (or previously used) page for the overwritten data. The page that contains the now invalid data will simply be marked as invalid and at some point it’ll get erased.



So, what would be the best way to securely erase files stored on a SSD? Overwriting with random data as we are used to from hard disks (e.g. using the "shred" utility) won't work unless you overwrite the WHOLE drive...


Answer



As stated by @teabot using full disk encryption software will circumvent the issue of secure deletion because you don't have to any more. However, as stated in a related question, this will have huge performance impacts because this prevents a lot of the controller's features like compression and TRIM and has been reported to decrease the performance up to a level where a normal hard disk is faster then the expensive SSD. For SandForce-based devices, there is a better solution: Those devices do AES encryption by default and the key will be wiped when you use the ATA secure delete feature, making all data unaccessible unless the attacker can break AES (128bit for current, 256bit for the new drives released in march 2011).


command line - Adding variables in a batch file in Windows

I'm trying to fix something that's simple but yet can't seem to put my finger on it.


I have this very simple batch file that when you drop a folder on it it converts a bunch of files to another format. I'm trying to add a progress indicator to the title bar but for some reason I can't get the set /a to add a value and return anything other than the value I initially put in.
here's the code


set Count=0
set NumFiles=0
set oldpct=-1
for %%A in (*.t64) do set /A NumFiles += 1
echo File count = %NumFiles%
echo.
echo Converting...
rem Parse every file in the folder and perform the magic.
for %%x in (*.t64) do (
set /A "Count += 1"
echo count: %Count%
pause
set /A pct=100*%Count%/%NumFiles%
%C1541_PATH%\c1541.exe -verbose off -silent on -format "fromt64,01" d64 "%%~nx.d64" -tape "%%x"
rem calculate progress
if "%pct%" gtr "%oldPct%" (
set oldPct=%pct%
echo %pct%
title Progress: %pct%/100
)
)
pause
exit
:F_Error
cls
echo FILE ERROR
echo.
echo This script only works on folders, not individual files.
pause
exit
:Error
cls
echo ---------------------- ERROR! ----------------------
echo.
echo Please drag and drop a folder on this batch file!
echo Please make sure C1541.exe is in the
echo correct folder and that the path value in
echo this file points to it.
echo Look near the top of the script, it is identified.
echo.
pause
exit

I deliberately omitted a part of the code at the start and the end in order to keep things short.


For some reason, the %count% and the %pct% refuses to be calculated...


When I try using delayedexpansion, I get this message


invalid filename error


But since it's a script that doesn't rely on the WOW64 or wmic, it shouldn't really matter the bit size I'm using (the command prompt smooths out everything)

restore - Retrieve files from a dd-ed btrfs partition

I have dd-ed a btrfs partition (from a Jolla phone), as per some last resort instructions to have a safety copy of it (see: notes in Mer's Sailfish/Backup Device wiki page, ). Perhaps wrongly so, after reading the Btrfs Gotchas wiki page.


[updated]
I want to copy a few files from within the subvolume home. Note, the files were not deleted. When I mount the subvolume of interest, I can navigate in directories and list files. However, every attempt to read or copy fails.


[updated] After dding back the image to an empty micro-SD card (an attempt to see if the failure to copy files, i.e. cp: reading 'filename': Input/output error, is due to what is mentioned
at http://superuser.com/a/793638/128768), as root, I do:


# list tree roots
btrfs restore -l /dev/sdc
tree key (EXTENT_TREE ROOT_ITEM 0) 46944256 level 2
tree key (DEV_TREE ROOT_ITEM 0) 35631104 level 0
tree key (FS_TREE ROOT_ITEM 0) 157016064 level 0
tree key (CSUM_TREE ROOT_ITEM 0) 82132992 level 2
tree key (QUOTA_TREE ROOT_ITEM 0) 67289088 level 0
tree key (UUID_TREE ROOT_ITEM 0) 32456704 level 0
tree key (259 ROOT_ITEM 0) 29503488 level 0
tree key (264 ROOT_ITEM 33) 116465664 level 2
tree key (265 ROOT_ITEM 34) 116400128 level 1
tree key (299 ROOT_ITEM 866702) 40960000 level 3
tree key (325 ROOT_ITEM 2361424) 119631872 level 2
tree key (327 ROOT_ITEM 2361546) 152805376 level 3
tree key (328 ROOT_ITEM 2361547) 84439040 level 2
tree key (DATA_RELOC_TREE ROOT_ITEM 0) 122241024 level 0

As per https://superuser.com/a/875265/128768, I do:


# mount the card
mount /dev/sdc /mnt/ddjolla
# enter in
cd /mnt/ddjolla/
# then, list subvolumes
btrfs subvolume list .
ID 259 gen 10 top level 5 path @swap
ID 264 gen 2361991 top level 5 path factory-@
ID 265 gen 2361991 top level 5 path factory-@home
ID 299 gen 2362013 top level 5 path @_old
ID 325 gen 2361991 top level 299 path @_old/factory-@
ID 327 gen 2484920 top level 5 path @
ID 328 gen 2484927 top level 5 path @home
# set default subvolume to one from which to revert files
btrfs subvolume set-default 328 /mnt/ddjolla
# unmount
umount /mnt/blah

Looks good so far. At this point,


# try to find root(s)
btrfs-find-root /dev/sdc
Superblock thinks the generation is 2484930
Superblock thinks the level is 1

whatever is on-going is too slow, consumes CPU resources and there is no sign of progress.


I "discovered", now, that likely the filesystem of the sdcard in which I directed the output file of dd was a FAT one! (See comments in Q&A full phone backup guide in https://together.jolla.com/questions/) Likely this was a no-go (for files >4GB) and the most of the data, from the original partition, are lost (which, apparently, was >4GB). Is that so?


For the records, here another piece of info


btrfs check /dev/sdc
Checking filesystem on /dev/sdc
UUID: 0f8a2490-53ed-4ff6-ba34-b81df3430387
checking extents
checking free space cache
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 46130921472
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 47204663296
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 49352146944
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 50425888768
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 51499630592
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 52573372416
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 53647114240
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 54720856064
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 55794597888
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 56868339712
checking fs roots
checking csums
checking root refs
checking quota groups
Qgroup is already inconsistent before checking
Counts for qgroup id: 265 are different
our: referenced 38080512 referenced compressed 38080512
disk: referenced 38080512 referenced compressed 38080512
our: exclusive 38002688 exclusive compressed 38002688
disk: exclusive 4096 exclusive compressed 4096
diff: exclusive 37998592 exclusive compressed 37998592
found 9357398016 bytes used err is 1
total csum bytes: 8866964
total tree bytes: 264663040
total fs tree bytes: 237322240
total extent tree bytes: 14561280
btree space waste bytes: 79581505
file data blocks allocated: 9901109248
referenced 8732901376

Is there anyway to troubleshoot this one and do btrfs restore -r ... as described in the reference answer? If not, and likely this is the case, perhaps this may serve as a useful mistake to avoid similar ones in the future.

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...