Difference between pages "ISO Images" and "Windows"

From TheBestLinux.com
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
<h3>
+
= Microsoft Windows =
ISO Image Command Line Examples
+
Or as some of us jokingly refer to the OS, Windoze~!
</h3>
 
  
'''How to Determine What Your CD or DVD Drive Uses for the Mount Point'''
+
= Info, Tips & Tricks =
* Use the "eject" command to open the drive, and then use the "dmesg" command to view kernel messages, the last of which should be something like this:
+
[[windows_cleanup|How to clean up your Windows installation to free up drive space]]
<pre style="color:blue">
 
[50208.534770] SELinux: initialized (dev sr0, type iso9660), uses genfs_contexts
 
</pre>
 
In the above example, the CD/DVD burner is device sr0, so the mount point of it is /mnt/sr0.
 
 
<br /><br />
 
<br /><br />
 
+
[[powershell|Windows PowerShell Information]]
'''The Best Way to Rip a DVD or CD from a Disk to an ISO File!'''
+
<br /><br />
First, you need to find out some info from the physical disk, so that the image you create is "'''EXACTLY'''" the same size as the original.  Without this info, the dd command used to create the ISO image file will add two additional bytes to the end of the image file.  By first running this command to find out the block size and volume size, you can force the dd command to create the ISO image with exactly the same number of bytes the original disk has!
+
[[cmd_tools|Windows command line tools, otherwise known as powerful stuff you can run from the DOS command prompt]]
 +
<br />
 +
<br />
 +
==== As a reminder, the quickest easiest way to open up a DOS command prompt window is to just click the "Start" button, type cmd and hit the ENTER key! ====
 +
<br /><br />
 +
[[keyboard_shortcuts|Keyboard shortcuts to save you time from taking your hands off the keyboard to use the mouse!]]
 
<br /><br />
 
<br /><br />
Run this command from the command prompt to find out the info required to rip the disk:
+
[[script|Cscript.exe is a command-line version of the Windows Script Host that provides command-line options for setting script properties.]]
<pre style=color:blue>
 
isoinfo -d -i /dev/sr0 | grep -i -E 'block size|volume size'
 
</pre>
 
Be sure to include the single quotes in the above example!  The output of the above command should look like this:
 
<pre style=color:blue>
 
Logical block size is: 2048
 
Volume size is: 3782
 
</pre>
 
 
<br /><br />
 
<br /><br />
Then, with the above block size and volume size given in my example above, use it to rip the disk:
+
[https://technet.microsoft.com/en-us/library/bb490887.aspx/ Excellent information on SCript!]
<pre style=color:blue>
 
dd if=/dev/cdrom of=test.iso bs=2048 count=3782
 
</pre>
 
 
<br /><br />
 
<br /><br />
When done, eject the newly burned disk with using the eject command, shown here, assuming the same DVD/CD burner drive, /dev/sr0
+
There is also the wscript command, which is almost identical to csript, other than it being targeted to running Windows based scripts, whereas cscript is meant to run console based scripts - those which run and complete in a DOS, aka, a command prompt window.
<pre style=color:blue>
 
eject /dev/sr0
 
</pre>
 
To close the DVD/CD tray, if your's has one, use the eject command with the -t switch, shown here:
 
<pre style=color:blue>
 
eject -t /dev/sr0
 
</pre>
 
 
<br /><br />
 
<br /><br />
 +
Windows creates a HUGE file over time, which is a database of all of the updates it has done. 
 
<br />
 
<br />
'''Create ISO Image From Any Disk or File Structure'''
+
The one on my current Windows VM I run on top of my Linux desktop is just over 1GB in size now, which is a large amount for virtual hard drive of only 100GB in size to begin with!
* If it is a disk you are copying to an ISO image, first un-mount it, using the umount command:
+
<br />
(Only one of the below commands are required, depending on your system and how it automatically mounts disks)
+
This file is usually located at C:\Windows\SoftwareDistribution\DataStore and is named DataStore.edb.
<pre style="color:blue">
 
umount /mnt/cdrom
 
 
 
OR
 
 
 
umount /mnt/sdd
 
 
 
OR
 
 
 
umount /mnt/sr0
 
 
 
OR
 
 
 
umount /run/media/username/disk_name
 
 
 
</pre>
 
 
<br /><br />
 
<br /><br />
* Use the dd command to create an exact image of the disk or file system:
+
In order to delete this file to free up the drive space it was hogging, you first need to stop the Update service,  
(Again, use the correct mounting point for your particular Linux system)
 
 
<br />
 
<br />
In all of these examples using the dd command, the tags if= and of= stand for "InputFile"= and "OutputFile"=
+
and then just delete the contents of the DataStore folder.
 
+
<br />
<pre style="color:blue">
+
Additionally you should also delete the contents of the Download folder, located at C:\Windows\SoftwareDistribution\Download,
dd if=/dev/sr0 of=ISO_Image_File_Name.iso
+
<br />
 
+
which should free up a lot more drive space!
OR
 
 
 
dd if=/directory_structure_name of=ISO_Image_File_Name.iso
 
 
 
</pre>
 
 
<br /><br />
 
<br /><br />
* A really nice way of creating an ISO image using the dd command along with some other command line arguments,
+
Then restart the service and run Windows updates again. The file should then get recreated, but it will be a lot smaller to star with, but will grow over time as the previous one had.
to create a nice ncurses based status indicator while it creates the image, allowing you to monitor the progress of ISO image creation:
 
<pre style="color:blue">
 
(pv -n /dev/sr0 | dd of=ISO_Image_File_Name.iso bs=2048 conv=notrunc,noerror) 2>&1 | dialog --gauge "Creating ISO Image...  Please stand by..." 10 70 0
 
</pre>
 
<br />
 
Example of above command:<br />
 
[[File:dd_ncurses.jpg]]
 
 
<br /><br />
 
<br /><br />
 
'''Create ISO Image from Mounted CD or DVD:'''
 
* In the example below:
 
** Replace "IMAGE_NAME.ISO" with what you want to name the ISO image file.
 
** Replace "/run/media/dir_disk_mounted_on/" with the entire path that the disk is mounted on.
 
** This exact same command can also be used to create an ISO image containing any mounted directory tree.
 
** Switches used in below example: -v = verbose output, -J and -R = Juliet & RockRidge extensions included for Windows compatibility.
 
<pre style="color:blue">genisoimage -o IMAGE_NAME.ISO -v -J -R /run/media/dir_disk_mounted_on/</pre>
 
 
<br /><br />
 
<br /><br />
 +
For more information on these and other Windows scripting and programming, see this excellent site: [https://www.experts-exchange.com/articles/17325/Difference-between-cscript-and-wscript.html Experts Exchange Scripting and Programming]
 +
<br />
 +
<br />
 +
How to mount an 'img' file:  [https://www.linuxquestions.org/questions/linux-general-1/how-to-mount-img-file-882386/]
 +
<br />
 +
<br />
 +
[[windows_server|Windows Server Information, Tips & Tricks]]
 +
<br />
 +
<br />

Revision as of 05:41, 5 June 2018

Microsoft Windows

Or as some of us jokingly refer to the OS, Windoze~!

Info, Tips & Tricks

How to clean up your Windows installation to free up drive space

Windows PowerShell Information

Windows command line tools, otherwise known as powerful stuff you can run from the DOS command prompt

As a reminder, the quickest easiest way to open up a DOS command prompt window is to just click the "Start" button, type cmd and hit the ENTER key!



Keyboard shortcuts to save you time from taking your hands off the keyboard to use the mouse!

Cscript.exe is a command-line version of the Windows Script Host that provides command-line options for setting script properties.

Excellent information on SCript!

There is also the wscript command, which is almost identical to csript, other than it being targeted to running Windows based scripts, whereas cscript is meant to run console based scripts - those which run and complete in a DOS, aka, a command prompt window.

Windows creates a HUGE file over time, which is a database of all of the updates it has done.
The one on my current Windows VM I run on top of my Linux desktop is just over 1GB in size now, which is a large amount for virtual hard drive of only 100GB in size to begin with!
This file is usually located at C:\Windows\SoftwareDistribution\DataStore and is named DataStore.edb.

In order to delete this file to free up the drive space it was hogging, you first need to stop the Update service,
and then just delete the contents of the DataStore folder.
Additionally you should also delete the contents of the Download folder, located at C:\Windows\SoftwareDistribution\Download,
which should free up a lot more drive space!

Then restart the service and run Windows updates again. The file should then get recreated, but it will be a lot smaller to star with, but will grow over time as the previous one had.



For more information on these and other Windows scripting and programming, see this excellent site: Experts Exchange Scripting and Programming

How to mount an 'img' file: [1]

Windows Server Information, Tips & Tricks