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 04-14-2006, 08:07 PM   #1
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Rep: Reputation: 15
parted and umount file systems


Hello all,

I've done some searching for similar threads to no avail so here goes:

What I'm trying to do is copy my / partition to another partition. From what I've read at GNU's documentation site, this is possible. Here's what I get from a parted print:

Using /dev/hda
(parted) p
Disk geometry for /dev/hda: 0kB - 40GB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 82MB 82MB primary ext3 boot
2 82MB 18GB 18GB primary ext3
3 28GB 39GB 10GB primary ext3
4 39GB 40GB 1045MB extended
5 39GB 40GB 1045MB logical linux-swap

You'll notice a gap between Number 2 and Number 3. I resized Number 2 and after I move / to Number 2 I'm going to resize Number 3 with what is leftover from the resize.

Number 3 is my root partition, 10GB and its too small. Of course from a command line while Linux is up and running, and issuing the command cp > /dev/hda> 3---of course it tells me that /dev/hda3 is busy and mounted. I want to copy / to Number 2. It of course makes sense that its busy and mounted while the system is up and running.

The issue I'm having is I boot up from a rescue disk (FC 5 by the way) and I've tried running in the root environment by issuing 'chroot /mnt/sysimage' and then running parted and trying to copy. I get the same error message: Partition /dev/hda3 is being used. You must unmount it before modifying it with Parted. I've tried everything I know to do.
How do you unmount /dev/hda3 when booting from a rescue disk and running linux rescue. I've boot from the rescue cd 'read only' and I still can't umount /dev/hda3. What gives? How can I get into the system while not being on / ??
Good question or am I brain dead?

Thanks,
Freestone
 
Old 04-14-2006, 09:27 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
You have already created the partitions so, I would proceed as follows.
Code:
1. Boot into FC5

2. Format /dev/hda2 with the command: mkfs.ext3 /dev/hda2

3. Create a folder and mount it...
mkdir /mnt/new
mount /dev/hda2 /mnt/new

4. Copy your existing root structure over to the /mnt/new with cpio...
find / -xdev -print0 | cpio -admvp0 /mnt/new

5. After the cpio is done, cd into /mnt/new and change the /boot/grub/grub.conf to add an entry showing the new location of FC5 .
For example:
# the original system on /dev/hda3
title Fedora Core (2.6.16-1.2080_FC5)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/hda3 rhgb quiet
	initrd /boot/initrd-2.6.16-1.2080_FC5.img

# the new system on /dev/hda2
title Fedora Core (2.6.16-1.2080_FC5)
	root (hd0,1)
	kernel /boot/vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/hda2 rhgb quiet
	initrd /boot/initrd-2.6.16-1.2080_FC5.img

6. While in the /mnt/new folder, edit the /etc/fstab for the / (root) and /swap as the LABEL= parts will not work on the system after it has been moved.
For example:
/dev/hda2               /                       ext3    defaults        1 1
/dev/hda5               swap                    swap    defaults        0 0

7. Start the grub utility and tell it where to look for grub in /dev/hda2 now.
For example:
grub
grub> root (hd0,1)
grub> setup (hd0)
grub> quit

8. Reboot and see if you can get into the new location ok. If not, you still have the original system in working order.
 
Old 04-14-2006, 09:38 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
I hate it when I have selective vision.
Since you have a separte /boot partition, you may be able to skip all the parts about grub.
 
Old 04-15-2006, 08:32 AM   #4
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
Thanks homey!

I appreciate your detailed response. I'll give it a shot later today when I have a few minutes to monkey around with this thing.

Thanks again,

Freestone
 
  


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
Incompatible file feature Fedora 3 / GNU Parted martinlinuxuser Linux - General 1 03-20-2005 10:39 AM
Is arrangement of file systems will differ if we copy a file from FAT 32 to ext 3 ? anindyanuri Linux - Software 2 02-20-2005 11:39 AM
About File Systems ahmed_alzahrani Linux - Newbie 3 08-31-2004 10:30 PM
What to do with parted*.back-RSN.README file degraffenried13 Linux - Newbie 1 12-15-2003 06:00 AM
about file systems anwar_lpk Linux - Hardware 1 11-29-2003 11:23 PM

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

All times are GMT -5. The time now is 12:32 PM.

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