Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 05-31-2003, 03:52 AM   #16
LQ Newbie
Registered: May 2003
Distribution: RH9 babeEE
Posts: 8

Rep: Reputation: 0

Ok question. (btw great job of explaining, this is really kewl, I actually am starting to understand how partions are working...)

I mistakingly had a second HD plugged in when I installed RH9.

It shows up:

[root@wolf root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hdb1             6.0G  618M  5.1G  11% /
/dev/hda1              99M  8.9M   85M  10% /boot
none                   62M     0   62M   0% /dev/shm
I am assuming that /dev/hdb1's '/' is where /etc /var /usr etc etc are located. (which is the drive I want to remove)

Question is, can I move that '/' off hdb1 and over to hda1. There should be space according to the df above.

If so, how do I do it.

Shouldn't fdisk show where /boot ends?

All I get is:

[root@wolf root]# fdisk /dev/hda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/hda1: 106 MB, 106896384 bytes
255 heads, 63 sectors/track, 12 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot    Start       End    Blocks   Id  System

Command (m for help):
Old 05-31-2003, 04:14 AM   #17
Senior Member
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
For moving entire partitions I like to use the following which I found in an older RAID HowTo
cd /dir/to/copy
(mount your fresh new drive)
mount /dev/hdX /dev/mnt
find . -xdev | cpio -pm /mnt/
the find . -xdev will 'find' all the files in the current directory and ignore other mount points under it. cpio -pm is a crufty little tool that will preserve file permisions/times/user/groups and the 'm' option does something special but I can't remember right now.

Say for example you have a mount schema like this.
part1 /boot
part2 /var
part3 /home
part4 /

If you were to start in the / directory you would copy everything *except* /boot /var /home to the /mnt directory. This comes in handy as you generally wouldn't want to copy all the data to the new volume. To copy the contents of the /var directory you would start in the /var directory or specify the path in the find command.

Repeating the same command will only copy files are newer than the files in the destination.
Old 05-31-2003, 10:25 PM   #18
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
once it's copied over to your new / partition, which will be something like hda2
/boot will remain hda1

you want to setup the fstab file to mount that device instead of hdb1 as / and also change the /boot mount point to the new / device, but leave the device as is /dev/hda1

example of new file

/dev/hda3 swap swap defaults 0 0
/dev/hda2 / reiserfs defaults 1 1
/dev/hda1 /boot reiserfs noauto,owner 1 2
/dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,user 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

of course your device may be different for / and swap, depends on how you partition the remaining space on hda

the filesystem you choose may be ext3 or whatever you decide instead of reiser
Old 05-31-2003, 10:28 PM   #19
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
don't forget to fix the boot loader to work wth the new setup


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
getting rid of rude/obscene members reddazz LQ Suggestions & Feedback 45 04-18-2007 10:42 AM
Rude boot up time.. xconspirisist Fedora 5 12-18-2003 12:51 PM
how many replies will it take? mymojo Linux - Games 27 11-05-2003 08:47 PM
No replies request dalek LQ Suggestions & Feedback 8 09-06-2003 10:12 PM
What to do if nobody replies, BUT... ? Debianewb LQ Suggestions & Feedback 5 10-27-2002 09:44 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:47 PM.

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