Find the answer to your Linux question:
Results 1 to 10 of 10
I have a partition on my HDD that has windows installed on it and another with debian. I don't use Windows any more, so I'd like to make that HDD ...
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Location
    South Africa
    Posts
    8

    Reclaiming space from windows

    I have a partition on my HDD that has windows installed on it and another with debian. I don't use Windows any more, so I'd like to make that HDD space available to Linux. Ideally, I don't want to have to re-install everything, since it took me many hours and tears just to get Debian to work the way I wanted it too (I'm not an experienced Linux user). Is there some way that I can delete the windows partition and give Debian access to the entire drive, without breaking my Debian installation?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Yes pretty easy to manage partitions using PartedMagic LiveCD but new partition creation might break Debian. We have to check existing partition structure of your HD first,
    Execute this in Terminal/Konsole :
    Code:
    su -
    /sbin/fdisk -l
    Post output here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Feb 2006
    Location
    South Africa
    Posts
    8
    Thanks for responding. Here's the output:

    Disk /dev/hda: 40.0 GB, 40020664320 bytes
    255 heads, 63 sectors/track, 4865 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Code:
    Device           Boot      Start         End       Blocks           Id        System
    /dev/hda1         *           1         1402     11261533+          7        HPFS/NTFS
    /dev/hda2                   1403        3834       19535040        1c       Hidden W95 FAT32 (LBA)
    /dev/hda3                   3835        3958       996030           82       Linux swap / Solaris
    /dev/hda4                   3959        4865      7285477+          83       Linux

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    All partitions are Primary and if delete hda1 and hda2, partition names will change and Debian will not boot up.
    You have to edit /boot/grub/menu.lst and /etc/fstab files before deleting first two partitions.

    Replace all instances of hda3 with hda1 and hda4 with hda2 in both files. Boot up from PartedMagic LiveCD, delete hda1 and hda2.
    Merge free space in hda3 ( It will become hda1).

    If you have any confusion, post the contents of both, menu.lst and fstab files here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Feb 2006
    Location
    South Africa
    Posts
    8
    I don't have a PartedMagic LiveCD. Is there some other way to safely delete the partitions or must I first obtain PartedMagic before I can continue?

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    You should use PartedMagic LiveCD only. Its just 30MB and one of the best Partition Manager.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Feb 2006
    Location
    South Africa
    Posts
    8
    Ok, I've obtained Parted Magic. Just to be safe, I'll post the menu.lst and fstab file contents.


    menu.lst
    Code:
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specifiv kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    # kopt=root=/dev/hda4 ro
    
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,3)
    
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true
    
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false
    
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery mode) single
    # altoptions=(recovery mode) single
    
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all
    
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true
    
    ## ## End Default Options ##
    
    title		Debian GNU/Linux, kernel 2.6.16.9 
    root		(hd0,3)
    kernel		/boot/vmlinuz-2.6.16.9 root=/dev/hda4 ro
    initrd		/boot/initrd.img-2.6.16.9 
    savedefault
    boot
    
    title		Debian GNU/Linux, kernel 2.6.16.9 (recovery mode)
    root		(hd0,3)
    kernel		/boot/vmlinuz-2.6.16.9 root=/dev/hda4 ro single
    initrd		/boot/initrd.img-2.6.16.9
    savedefault
    boot
    
    title		Debian GNU/Linux, kernel 2.4.27-2-386 
    root		(hd0,3)
    kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda4 ro 
    initrd		/boot/initrd.img-2.4.27-2-386
    savedefault
    boot
    
    title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
    root		(hd0,3)
    kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda4 ro single
    initrd		/boot/initrd.img-2.4.27-2-386
    savedefault
    boot
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    
    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title		Other operating systems:
    root
    
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/hda1
    title		Microsoft Windows 2000 Professional
    root		(hd0,0)
    savedefault
    makeactive
    chainloader	+1
    
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/hdb1
    title		Microsoft Windows 2000 Professional
    root		(hd1,0)
    savedefault
    makeactive
    chainloader	+1
    fstab
    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    /dev/hda4       /               ext3    defaults,errors=remount-ro 0       1
    /dev/hda3       none            swap    sw              0       0
    #/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0
    /dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    /dev/hda1 and hda4 are Windows Partitions. If you delete both, partition numbers will change and Debian will not boot up.

    Edit menu.lst and /etc/fstab files.

    menu.lst :
    Code:
    title		Debian GNU/Linux, kernel 2.6.16.9 
    root		(hd0,1)
    kernel		/boot/vmlinuz-2.6.16.9 root=/dev/hda2 ro
    initrd		/boot/initrd.img-2.6.16.9 
    savedefault
    boot
    /etc/fstab :
    Code:
    /dev/hda2       /               ext3    defaults,errors=remount-ro 0       1
    /dev/hda1       none            swap    sw              0       0
    Save files and boot up from PartedMagic LiveCD. Delete /dev/hda1 and hda2. /dev/hda3 and hda4 will become /dev/hda1 and hda2 respectively. Merge free space into /dev/hda2.

    Back up Data before changing partition structure.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Feb 2006
    Location
    South Africa
    Posts
    8
    Thank you for your help. I will try this.

  10. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Okk ! Do let me know how it goes. Good Luck !
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •