LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-16-2006, 05:10 PM   #1
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
delete windows partition and move linux up


Here's the situation.

My laptop is dying. Old age. I think the board is going. The other day I was playing swat4 and it tripped off. Then that scent of buring silicon every tech knows comes up. Damn. Something burnt on the board and now the fan comes on like full blast (in windows)-I'm afraid some chips may burn out. However IF I boot into linux and set the throttling to powersave, all is good and the system works.

So Tux saves the day.
I wanna dump my windows partitions and from this
windows-15G
linux - 10g
swap - 700M
data - 32G

and resise my drive to this
linux -10G
swap - 800M
home/data partition- the rest


Code:
Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1945    15623181    7  HPFS/NTFS
/dev/hda2            1946        3161     9767520   83  Linux
/dev/hda3            3162        3246      682762+  82  Linux swap
/dev/hda4            3247        7295    32523592+   c  W95 FAT32 (LBA)
I don't wanna risk reinstalling cause I swear this thing is gonna go up in smoke.

How do I dd it?
 
Old 03-16-2006, 05:38 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The least amount of refomatting could be had if you reformat /dev/hda1 (was ntfs) and use it for the /usr partition, and reformat the /dev/hda4 partition and use it for /home. You might want to temporarily give them different mount points, such as /mnt/usr and /mnt/home, so that you can copy the contents of /usr and /home to the new locations before making the final change to your /etc/fstab file.
Before rebooting, A) rename the old /home and /usr directories and create new (empty) directories for the mount points. For example /home -> /home-old; /usr -> /usr-old. This way, you won't be mounting over the previous directories which would hide there contents. Then if everything works out, you can delete the old contents.

P.S. That must be some game to burn out the processor like that! I though that was just a Sci-Fi plot gimmick.
 
Old 03-16-2006, 05:59 PM   #3
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 454

Rep: Reputation: 32
Take care of the overheating first. You are on borrowed time. It could be dust build-up.

You could play Towers of Hanoi to move stuff around on a running system, but it is tricky because /etc/fstab would be needing editing and you need to reboot after repartitioning. If you cannot move the stuff to another drive, just re-install.
 
Old 03-16-2006, 06:06 PM   #4
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
if you cant move to another drive just put in a liveCD and resize from there. DSL should work fine
 
Old 03-16-2006, 07:51 PM   #5
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
All in all I figured it out.

jschiwal, thats I good idea. I didn't think of reusing space to avoid formatting. Will put that to good use on some failing drives I've come accross.


Quote:
Originally Posted by RobertP
Take care of the overheating first. You are on borrowed time. It could be dust build-up.

You could play Towers of Hanoi to move stuff around on a running system, but it is tricky because /etc/fstab would be needing editing and you need to reboot after repartitioning
I did scrap it down and had the fins dusted out with compressed air a couple of months ago.
And yes I moved the partitions and forgot to update /etc/fstab


tamoneya, the live-cd yes, but I was trying to avoid cause most live cds have acpi management but no processor throthling. <I did have to use it at some point to fix /etc/fstab> lol



Heres what I did
1-used cfdisk to delete the ntfs partition
2-created back a 10gig root /
unfortunately <and I don't know why> the recreated partition came up 32bytes short
Code:
/dev/hda1   *           1        1217     9767488   83  Linux
/dev/hda2            1946        3161     9767520   83  Linux
/dev/hda3            3162        3246      682762+  82  Linux swap
/dev/hda4            3247        7295    32523592+   c  W95 FAT32 (LBA)
causing this command to fail <cause its smaller>
Code:
dd bs=1024 count=9767520 if=/dev/hda2 of=dev/hda1
3-I then recreated the new.to.be.root partition 10 megs larger and came up with this when formated

Code:
/dev/hda1   *           1        1217     9775521   83  Linux
/dev/hda2            1946        3161     9767520   83  Linux
/dev/hda3            3162        3246      682762+  82  Linux swap
/dev/hda4            3247        7295    32523592+   c  W95 FAT32 (LBA)
which you can see is larger than the original so the dd command above worked.

4-When the dd copy finished I mounted and chrooted into /dev/hda1 to reinstall and reconfigure grub <and yes I shoulda remembered to fix the /etc/fstab too>
5-Rebooted and it mounted /dev/hda2 <oops> fixed that to /dev/hda1
5-Reboot and here I am. YAY!


Thank you all in your advice.
I'm gonna reclaim my unused space and fix my other partitions!

Last edited by Mr_C; 03-16-2006 at 08:05 PM.
 
Old 03-17-2006, 04:46 AM   #6
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 454

Rep: Reputation: 32
Brain surgery was a success!

Last edited by RobertP; 03-17-2006 at 01:06 PM.
 
Old 03-17-2006, 11:02 AM   #7
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by RobertP
Brain sugrery was a success!
YaY! I'm happy I was successful.
 
Old 03-17-2006, 01:28 PM   #8
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
One more thing
second partition in /etc/fstab

/dev/hda2 /mnt/Data reiserfs defaults,user,rw 1 1

I can mount the filesystem as a user but I can't write to it.

---FIXED>had to mount it and THEN chmod -R 0777 /mnt/Data as root

Last edited by Mr_C; 03-17-2006 at 01:33 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Linux partition oldi Linux - Newbie 7 12-07-2004 10:47 AM
delete windows partition jnsenit Linux - General 3 11-28-2004 01:37 PM
move xp partition for linux davidleroux1 Linux - Software 4 11-27-2004 03:16 PM
Move /home to Windows Partition Campy19 Mandriva 2 11-23-2003 12:24 AM
how to move a linux file to a windows partition exidez Linux - Newbie 5 10-30-2003 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration