Friday, February 26, 2016

Extend the Ubuntu partition size with available free space in Windows ( Dual boot system)

 Scenario:

I have dual boot system with Windows 8 and Ubuntu. Ubuntu partition has very less space 15 GB so I was unable to install and run the programs effectively. I had 100 GB free on other partition so I merged that free space into Ubuntu partition. I followed the following steps which worked fine for me without losing anything. (*Pics are for reference)

STEPS: 
1.  Boot the computer with the Linux live CD or USB.
2. Start GParted in live Ubuntu session, Most of the cases installed , if not than install from software manager.

3. If you have swap partition(s), right click on it/them and select swapoff (Edit: you can skip this as your snapshot does not show any swap used), 




4.  As Gparted  can add the space from space preceding and space following, we need to add the empty unallocated partition ahead of Ubuntu partition.


5.(WARNING: moving /boot partition may cause boot failure!) Now right click your extended partition /dev/sda2 (in your case) and select Resize/Move option, and drag the slider left to cover the unallocated space. Repeat the process with /dev/sda5 to cover the space created in the extended partiton. And then click the Resize/Move button, 




6.   After specifying such move and resize options, from the menu select Edit -> Apply All Operationsor click the apply button in the toolbar. The resize and particularly move option will take a long time depending on the size of the files to be moved. So wait patiently. 


7.      After creating unallocated partition before the Ubuntu partition you can add those partition as on step 5 &6 to its main partition. You can on the Swap by right clicking on the Swap partiion.
8.      You should then be done! Reboot to see if every thing is fine. If something went wrong and  you're unable to boot, try boot-repair to fix it.
9.     Install Boot-Repair in Ubuntu
Ø  connect to the Internet
Ø  open a new Terminal, then type the following commands (press Enter after each line):
Ø  sudo add-apt-repository ppa:yannubuntu/boot-repair
Ø  sudo apt-get update
Ø  sudo apt-get install -y boot-repair && boot-repair
10. Launch Boot-Repair from either :
    1. the Dash (the Ubuntu logo at the top-left of the screen)
    2. or by typing 'boot-repair' in a terminal
11. Then click the "Recommended repair" button. When repair is finished, note the URL (paste.ubuntu.com/XXXXX) that appeared on a paper, then reboot and check if you recovered access to your OSs. If the repair did not succeed, indicate the URL to people who help you by email or forum.

12. It may be that Windows option may not be displayed in Grub. On that case open the Ubuntu and go to Terminal and update the Grub.
 sudo apt-get update grub

13. It may be that you are getting window option but on clicking it , new windows comes stating you to repair your window due to some corruption on. If it occurs follow the following steps:

  •     Insert the live CD or USB for your windows and boot from it by changing boot sequence from your BIOS
  • Select to repair the windows and move to the Command line repair mode from the advance option.
  •  In the command line, type the following command to fix your boot error
        bootrec /fixmbr
        bootrec /fixboot
        bootrec /rebuildbcd

  •  Exit from the command line and reboot your computer in normal mode.


14. Hopefully now you might get extended partition without losing your data.

Tuesday, July 30, 2013

Recovering unallocated space of a USB flash drive.



Let’s remove unallocated space. First of all run Windows command line and type diskpart in the command prompt. Windows will ask you for Administrator permissions to run the tool. Then run list disk command to find your USB flash disk’s number. It should be the same as disk’s number in Computer Management tool. It was 1 in my case. Next you should chose the disk to work with. Type select disk <disk number> command, e.g.select disk 1. The next step is to clean all volumes and partitions on the disk. Use clean command to do that. The last step is to create a primary partition. You can do that using create partition primary command. That’s all. You should be able to format your flash disk now.
This is how I removed unallocated space on my machine:
Microsoft DiskPart version 6.2.9200
Copyright (C) 1999-2012 Microsoft Corporation.
On computer: COMPUTER
DISKPART> list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          298 GB      0 B
  Disk 1    Online         7509 MB  6619 MB
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> exit

Sunday, August 14, 2011

Flash Drive Not Detected

Some times our computer do not obey us and do not want to detect mass storage device.At that time just treat it this way,,
1.Open device manager (if by run terminal than type devmgmt.msc)
   or directly right click on my computer and choose manage
   -on that select device manager
2.Go to universal serial bus controller
3.Select  mass storage and through right click on it uninstall it.
4.Restart your computer
5.Now  ur computer will automatically install device driver software for it
 Best of luck

Wednesday, December 29, 2010

WAY TO DOWNLOAD VIDEO FROM YOUTUBE USING LINUX

It seems easy to download video from youtube when we use windows but for linux it is some what hard,,but there is solution of many problem in internet.

We use terminal in linux  to download video from youtube and it's URL.Here is some method ,,

sudo apt-get install youtube-dl
youtube-dl  http://www.youtube.com/video/url/ 
But some time we find like this problem..

Ubuntu ForumsRetrieving video webpage... done.
Extracting URL "t" parameter... failed.
Error: unable to extract URL "t" parameter.
Try again several times. It may be a temporary problem.
Other typical problems:

* Video no longer exists.

* Video requires age confirmation but you did not provide an account.
* You provided the account data, but it is not valid.
* The connection was cut suddenly for some reason.
* YouTube changed their system, and the program no longer works.


It may be due to mistake in URL  or most probably due to not updted youtube-dl which is requires for download.
You can update it by either


sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-dl
Or 
manually download the .deb files if you want.
 
and than follwing aagin the above mentioned command..
Have once download...

Monday, December 13, 2010

Solution for :Unable to formatting Flash drive (RAW format)

If u r not able to format ur flash drive  using windows ,than check it's properties..and find some conclusion.
It may be seen like as..

 
We can can conclude from it that file system of flash drive has been changed,,
Now try to format it using CMD(Command Prompt) ..
But   when this case happen to me I was unable to format using CMD.Than I tried from disk management option available in computer management which we use while partition of our  hard drive.There I saw that flash drive was as unallocated volume ,than I right clicked on it where I got option at top  of making new volume as when we get  at time of partiton of our drive after it get's unallocated .(Formatting option of here may not work),Than dialogue box will be shown,.go on selecting FAT format and ur removale drive wil be in usable format..

Best of luck..
For any query please comment


Assembly language Programm for Interfacing LM35 with 8051controller using ADC0808

Temperature of surrounding is sensed by temperature sensor and it send it's o/p as DC voltage to Analog to digital Converter 0808 through which we give 8 bit value of that voltage to microcontrller 8051.After it's processing it is displayed in LCD ...

ASSEMBLY   LANGUAGE     PROGRAM FOR

                        WEATHER   MONITORING  SYSTEM


                   USING:: 1. MICROCONTROLLER  89C61X2
                                   2.ADC 0808
                               3. TEMPERATURE SENSOR LM35D
;================================================= ==============;

org 0000h
BEGIN:
mov A,#38h                                                ;initialie 2 line LCD
ACALL command
mov A,#0ch                                                  ;LCD on cursor off
ACALL command
mov A,#01h                                                 ;clear LCD
ACALL command
mov A,#06h                                                 ;Shift cursor right
ACALL command
mov A,#'T'
ACALL DISPLY
mov A,#'E'
ACALL DISPLY
mov A,#'M'
ACALL DISPLY
mov A,#'P'            

ACALL DISPLY
mov A,#'='
ACALL DISPLY
 ACALL ADC
ACALL BINTOASC
;;;;;;;;;;;;;;;;;;;;;DISPLAY ASCII NUMBERS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov A,#06h                                                         ;Shift cursor right
ACALL command
mov A,34h                                                        ;Disply MSb of ASCII
ACALL DISPLY
mov A,#06h                                                      ;Shift cursor right
ACALL command
mov A,33h                                                       ;Display middle ASCII
ACALL DISPLY
mov A,#06h                                                     ;Shift cursor right
ACALL command
mov A,32h                                                       ;DISPLAY LSb ASCII
ACALL DISPLY
mov A,#'d'
ACALL DISPLY
mov A,#'C'
ACALL DISPLY
acall delay
acall delay
acall dac                                    ;for analog conversion;;;;
acall delay
sjmp BEGIN                               ;Jump to the top repeat the whole process
;;;;;;;;;;;;;;;;;;;TO INITIALIZE LCD BY;;;;;;;;;;;;;;;;;;;

command:
ACALL READY                                   ;Is LCD ready
mov p0,A                                             ;Issu command
clr p2.7                                           ;RS=0 for comand instruction
clr p2.6                                          ;R/W=0 to write LCD
setb p2.5                                        ;H->L for to latch information in at data lines
clr p2.5
ret
;;;;;;;;;;;;;;;;;;TO DISPLAY USER DATA;;;;;;;;;;;;;;;;;;;;;
DISPLY:
ACALL READY
mov p0,A                                      ;Issu data
setb p2.7                                       ;RS=1 for data
clr p2.6                                         ;R/W=0 to write LCD
setb p2.5                                     ;H->L for to latch information in at data lines
clr p2.5
ret
;;;;;;;;;;;;;;;;;TO CHECK LCD READY TO RECIEVE DATA TO SHOW;;;;;;;;;;;;;;;;;;;;;;;;;
READY:
setb p0.7
clr p2.7                                                ;RS=0 for command register
setb p2.6                                             ;R/W=1 to read command register
BACK:
clr p2.5                                              ;H->L to latch the data
setb p2.5
jb p0.7,BACK                                 ;Busy flag(P1.7)=1 indicates LCD is not ready to recieve data
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;READS ADC DATA;;;;;;;;;;;;;;;;;;;;;;
ADC:
mov p1,#0ffh                                  ; taking port p1 As data input port
clr p3.2                                                    ;L->H for ALE enable
clr p3.5                                                    ;clr sc
setb p3.3                                                     ; for eoc
setb p3.2                                                     ; for ale
clr p3.4                                                         ;oe pin
clr p3..2
setb p3.5                                                          ;SC=1->0
nop
clr p3.5                                                  ;H->L to start conversion
WAIT:
JB p3.3,WAIT                                         ;Wait for end of conversion EOC
 setb p3.4                                              ;OE 1->0 to enable output from ADC
acall delay
mov A,p1                                                       ;Read data
MOV 35H,A
setb p3.4                                                  ;To disable read to start next conversion
setb p3.3                                                    ;eoc
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;BINARY TO ASCII CONVERSION;;;;;;;;;;;;;;;
BINTOASC:
mov A,35h                                                          ;Input from ADC
mov B,#10                                                           ;Divide by 10
div AB
mov r0,B                                                              ;Move remainder into R0
mov B,#10
div AB                                                                   ;Divide quatient by 10
mov r1,b                                                              ;Move remainder in R1
mov r2,A                                                              ;Move quatient in R2
mov A,r1                                                              ;Move second BBCD in A
swap A
orl A,r0                                            ;OR 3rd & 2nd BCD to form compact BCD
mov 30h,A                                       ;Saves 2nd&3rd BCD at RAM location 30h
mov 31h,r2                                         ;Saves 1st BCD at RAM location 31
;;;;;;;;;;;;;;;;;;;;;;;;;;CONVERTION FROM BCD TO ASCII;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov A,30h                                     ;Takes 2nd&3rd BCD from RAM location 30h
ANL A,#0fh                                           ;Mask the upper NIBBLE
orl A,#30h                                              ;Convert lower nibble in ASCII
mov 32h,A                                       ;Save MSb ASCII at RAM location 32H
mov A,30h                                       ;Move BCD into A from RAM location 30H
anl A,#0f0h                                         ;Mask lower NIBBLE of BCD
swap A                                            ;Interchange lower and higher NIBBLE
orl A,#30h                                            ;Convert it in ASCII
mov 33h,A                                          ;Save 2nd ASCII at RAM location 33H
mov A,31h                                        ;Takes 1st BCD from RAM location 31H
anl A,#0fh                                           ;Masks upper nibble
orl A,#30h                                           ;COnvert into ASCII
mov 34h,A                                        ;Saves MSb ASCII at RAM location 34H
ret
;;;;;;;converting data into analog form again;;;;;;;;;;;;;
dac:
    mov a,35h
                mov p1,#00h                                   ;port p1 as o/p port
                setb p3.7                                             ;dac write pin
                acall delay
                mov p1,a
                acall delay
                 ;clr p3.7
                 ret
;;;;;;;dealay required for program;;;;;
DELAY:   mov r0,#255
  loop1:    mov r1,#255
                  LOOP:djnz r1,loop
            djnz r0,loop1
  ret

end



Saturday, October 9, 2010

How The Crystal Oscillator Starts Oscillating..

Quartz crystal oscillator that we use in micro-controller lab oscillates giving constant frequency.Have u thought how does it starts oscillating.

As far as I know ,a crystal of quartz is properly cut and mounted so that it can be made to distort in an electric field by applying a voltage to an electrode near or on the crystal.This property is known as piezoelectricity.This means we apply certain voltage at starting  and than after due to piezoelectric effect it continue oscillating.  When the field is removed, the quartz will generate an electric field as it returns to its previous shape, and this can generate a voltage. 

It means, pin of micro-controller at first supply voltage..what do u think??