Header Shadow Image


Cloning NTFS 1TB disk to 240GB SSD

The key to this is that the enterity of the data HAS to fig into the new space.  If it doesn't, you'll either need to get a bigger disk or start deleting stuff off the old disk.  In my case the data was 120GB so it can easily fit in a 240GB SSD.  Now, if you just want a quick solution, skip to step 21.  But if you want the longer Linux attempt, read steps through first, then follow them from top to bottom.  However in my case, I could not get the Linux solution to work.  However, others have.  NOTE: I don't make any guarantees here.  Ensure you make a backup copy of your drive first.  Never work directly with the individual if given a choice.


1) Create smaller partitions including the Recovery and System Reserved and main partition USING Windows.  Try to mimic the partition definition of your existing disk, except make the primary partitions that hold all the data smaller.  I found the Linux commands don't really create the boot records appropriately and your system won't boot if you try to use Linux to creating these.  YMMV however.  Tools like ntfs-3g help but still fall short.

2) Once you have the partitions defined, add the disk to a Linux system and rsync the various folder of the old disks to the new disk.  To make this safer and less prone to potential errors, I used ntfs-3g to clone the old disk partitions then mount the old partitions on my linux image via the loopback device ( mount -o loop ….. )  In case of issues, I only corrupt the image I've taken, NOT the original drive.

3) Mount the images on Linux.

4) Rsync everything over.  In this case I used something like this for all 3 windows partitions:

36828  rsync -rltDvu –modify-window=1 –progress –delete /mnt/sdm1/ /mnt/sdg1/
36831  rsync -rltDvu –modify-window=1 –progress –delete /mnt/sdm2/ /mnt/sdg2/
36834  rsync -rltDvu –modify-window=1 –progress –delete /mnt/sdm3/ /mnt/sdg3/

5) Wait.

6) Wait some more.

7) Or just let the thing run overnight.

8) Make the original primary partition active.  You can check your windows original disk to see what that was or fdisk -l will tell you. 

9) Try to boot up.

10) You might get this error:

Recovery

Your PC/Device needs to be repaired
The application or operating system couldn't be loaded because a required file is missing or contains errors.
File:\\WINDOWS\system32\winload.exe
Error code: 0xc000000e

You'll need to use recovery tools.  If you don't have any installation medis (like a disc or USB device), contact your PC administrator or PC/Device manufacturer.

11) Remount the disk on Linux and check the C:\WINDOWS\ folder.  It might be empty. 

12) You may get this error:

[root@mbpc-pc mnt]# mount /dev/sdg2 /mnt/sdg2
Windows is hibernated, refused to mount.
Failed to mount '/dev/sdg2': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
[root@mbpc-pc mnt]#

13) You may be told this will fix it:

[root@mbpc-pc mnt]# ntfsfix /dev/sdg2
Mounting volume… Windows is hibernated, refused to mount.
FAILED
Attempting to correct errors…
Processing $MFT and $MFTMirr…
Reading $MFT… OK
Reading $MFTMirr… OK
Comparing $MFTMirr to $MFT… OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition… OK
Going to empty the journal ($LogFile)… OK
Windows is hibernated, refused to mount.
Remount failed: Operation not permitted
[root@mbpc-pc mnt]#

14) But in reality this is what you might need (CAREFUL: This removed the hibernate file so you might loose saved data.)

remove_hiberfile
              When  the  NTFS volume is hibernated, a read-write mount is denied and a read-only mount is forced.
              One needs either to resume Windows and shutdown it properly, or use this option which  will  remove
              the  Windows  hibernation file. Please note, this means that the saved Windows session will be com-
              pletely lost. Use this option under your own responsibility.

15) You're going to try it.

[root@mbpc-pc mnt]# ntfs-3g -o remove_hiberfile /dev/sdg2 /mnt/sdg2
[root@mbpc-pc mnt]#

16) Happy Moment!

[root@mbpc-pc sdg2]# mount|grep -Ei sdg2
/dev/sdg2 on /mnt/sdg2 type fuseblk (rw,allow_other,blksize=4096)
[root@mbpc-pc sdg2]#

17) Run the rsync again.  This time pipe the output to a log file to analyze.

rsync -rltDvu –modify-window=1 –progress –delete /mnt/sdm2/ /mnt/sdg2/ 2>&1 | tee -a./what-the-hell.log

18) Analyze the log or check what was missed.

19) But alas it was not meant to be.  However I try to add the 3 plugins on the ntfs-3g page, they fail to detect on this Scientific Linux 6.7 with Kernel 4.8.4. More on the issue of unsupported reparse point issue.

20) Fcuk!

21) Ok, we're waisting time now.  Obviously the Linux route isn't yet fully mature being rough around the edges.  Great project, but not quite there yet.  Searching, I came across the AOEMI Backupper.  ( And believe me, it functions better then the name would suggest )

22) Following the instructions, the free version did EVERYTHING cloning the 1TB disk over to the 240GB SSD.  And yes, it even shrunk the partitions to scale.  The only thing you had to do is make sure the data on the disk would fit on a 240GB SSD.  Otherwise the bets are off.

Cheers,
TK

ntfs-g3 / ntfsclone warning: careful about use of parameters in this manner.

Careful when copying or cloning using ntfs-g3 / ntfsclone command when using overwrite.  In the below example /dev/sdg4 is NOT the source.  It is the TARGET.  :(

ntfsclone –overwrite /dev/sdg4 /dev/sdm1

Though nothing happened here, these were two test volumes, this is opposite to the way other commands work like cp, scp, rsync:  The last entry is the target.  The first entry is the source.  The paramaters are modifiers on the function of the command during the operation.

In the case of ntfsclone command, the overwrite parameter takes a file as it's target completing the command but causes a reverse situation that can be potentially destructive. Hence, if you're thinking of the standard <COMMAND> <TARGET> <SOURCE> syntax, this command will not work:

ntfsclone /dev/sdg4 /dev/sdm1

It just prints the help page without indicating what's wrong.  Though you might expect similar behaviour to other Linux commands.  For new Linux users, this might not be a major issue but for seasoned professionals who are used to the tradtitional Linux syntax, this can be a nasty gotcha: The TARGET is not the last parameter. 

[root@mbpc-pc ntfs-3g_ntfsprogs-2017.3.23]# ntfsclone –overwrite /dev/sdg4 /dev/sdm1
ntfsclone v2017.3.23 (libntfs-3g)
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 240054763520 bytes (240055 MB)
Current device size: 240054764544 bytes (240055 MB)
Scanning volume …
100.00 percent completed
Accounting clusters …
Space in use       : 2346 MB (1.0%)
Cloning NTFS …
100.00 percent completed
Syncing …
[root@mbpc-pc ntfs-3g_ntfsprogs-2017.3.23]#

Though the man page hints at this:

       -O, –overwrite FILE
              Clone NTFS to FILE, which can be an existing partition or a regular file which will be overwritten if it exists.

someone used to the tradtitional syntax could quickly forget this overwriting their files.  Hence why this version of the command will make sense given the function described in the man pages:

ntfsclone /dev/sdm1 –overwrite /dev/sdg4

Cheers,
TK

Steam must be running to play this game (Steam initialisation failed)

If you get this error:

Steam must be running to play this game (Steam initialisation failed)

 trying to play your favorite game on steam, you'll have to make an adjustment to the binary file (in this case it will be abc.exe) to get it to work.  I tried to run the game by making the regular user an administrator or with administrative previlidges and it worked just fine.  However the point ofthis workaround is to have the game run as a non previlidged user instead of granting elevated access permissions for the money you spent on the game.  Below is how we do just that.  Keep in mind that we don't guarantee your results here.  Editing a compiled executable will void any warranty and we don't recommend reading any further if you have any reservations about doing so.  Some games should come with a warning if you spend money and the game doesn't work off of steam since 2015.  

Read the rest of this entry »

Disable Chrome Guest Account

As of chrome version 59, the option to drop the guest account is no longer present. This is a problem because if you enable supervised users that restrict access, the guest account will be available as a choice to any user, thereby circumventing any restrictions in place on supervised users.

There is a way around this issue. Type chrome://policy/ into your browser then uncheck the Show policies with no value set checkbox at the top right side of the window.

The one we want is called BrowserGuestModeEnabled . Next run regedit.exe and browse and set the following:

Registry Area HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
Registry Path Software\Policies\Google\Chrome
Value Name BrowserGuestModeEnabled
Value Type REG_DWORD
Enabled Value 1
Disabled Value 0

Next, you will need to set this policy.

Cheers,
TK

SAN: High Level Overview

A picture says a thousand words:

 

SAN: High Level Diagram

Cannot add dependency job for unit firewalld.service, ignoring: Unit firewalld.service is masked.

Restore firewalld.service file contents.

[root@idmipa01 ~]# systemctl enable firewalld
Failed to execute operation: Operation not supported
[root@idmipa01 ~]# 

[root@idmipa01 ~]# systemctl enable firewall
Failed to execute operation: Access denied
[root@idmipa01 ~]# 

[root@idmipa01 system]# vi firewalld.service
[root@idmipa01 system]# systemctl enable firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/basic.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
[root@idmipa01 system]# systemctl start firewalld
[root@idmipa01 system]#
[root@idmipa01 system]#
[root@idmipa01 system]#
[root@idmipa01 system]# cat firewalld.service
[Unit]
Description=firewalld – dynamic firewall daemon
Before=network.target
Before=libvirtd.service
Before=NetworkManager.service
Conflicts=iptables.service ip6tables.service ebtables.service

[Service]
EnvironmentFile=-/etc/sysconfig/firewalld
ExecStart=/usr/sbin/firewalld –nofork –nopid $FIREWALLD_ARGS
ExecReload=/bin/kill -HUP $MAINPID
# supress to log debug and error output also to /var/log/messages
StandardOutput=null
StandardError=null
Type=dbus
BusName=org.fedoraproject.FirewallD1

[Install]
WantedBy=basic.target
Alias=dbus-org.fedoraproject.FirewallD1.service
[root@idmipa01 system]#

 

 

/etc/resolv.conf is getting overwritten

So /etc/resolv.conf was getting consistently overwritten even though NetworkManager was removed using rpm -e $(rpm -aq|grep Network Manager).  To find the culprit, we checked what is running on this CentOS 7 system using:

Read the rest of this entry »

Setting Temporary Network Addresses

Setting Temporary Network Addresses

ip a add 192.168.0.200/255.255.255.0 dev eth0
ip route add default 192.168.0.1/255.255.255.0 dev eth0

Cheers,
TK

INFO task kworker blocked for more than 120 seconds.

Well one day we get this issue (INFO task kworker blocked for more than 120 seconds.):

Read the rest of this entry »

VMware : Unable to connect to the MKS: Login (username / password) incorrect

For this error make sure that the Windows Firewall with Advanced Security has the following two rules enabled on both the Domain and Private profiles:

VMware Authd Service
VMware Authd Service (private)

Cheers,
TK


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License