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 05-31-2005, 12:28 PM   #16
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35

When you boot off a Linux Install CD, CD's Linux boots into your RAM, creates little root file system there, etc. to be able to make anything.
When you run the described commands, you create "/mnt/root" and "/mnt/home" dirs in your RAM for Linux to use. Then you mount your HDD directories there to access them to copy from "/temp" (which is now mounted as "/mnt/root/temp") to "/home" (which is now mounted as "/mnt/home").
You just manipulate your data from "another" Linux.
 
Old 06-02-2005, 03:22 AM   #17
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
HD repartitioned

H folks,

I got my HD repartitioned. Steps taken as follows;

1. Boot into "init 1" (GRUB Bootloader)

2.
sh-3.00# mount /dev/hda5 /mnt
Already mount

3.
sh-3.00# mkdir /home2 && cp -ar /mnt/* /home2/

4.
sh-3.00# umount /dev/hda5

5.
Used fdisk to delete partition hda5 and to recreate 3 new partitions in the space left

sh-3.00# fdisk /dev/hda
Command (m for help): (type) d
Partition number (1-5): (type) 5

Command (m for help): (type) n
First cylinder (2691-4865, defult 2691): press [Enter]
Using default value 2691
Last cylinder of +size or +sizeM or +sizeK (2691-4865, default 4865): (type) +10000M and press [Enter]

Command (m for help): (type) n and press [Enter]
First cylinder (3908-4865, defult 3908): press [Enter]
Using default value 3908
Last cylinder of +size or +sizeM or +sizeK (3908-4865, default 4865): (type) +6000M and press [Enter]

Command (m for help): (type) n and press [Enter]
First cylinder (4638-4865, defult 4638): press [Enter]
Using default value 4638
Last cylinder of +size or +sizeM or +sizeK (4638-4865, default 4865): press [Enter]

Command (m for help): (type) w and press [Enter]

Partition table has been altered!
Calling ioctl() to read partition table
Warning: Re-reading the partition table failed with error 16: Device and resource busy
The kernel still uses the old table
The new table will be used at the next reboot
Syncing disk

sh-3.00# (type) reboot and press [Enter]

FedoraCore3 rebooted and step 1. above was repeated to boot into "init 1" again.
Now the trick was here.

At end of booting a warning popup requesting to enter password and run "fsck". I tried half an hour to get it fixed without result. Then I continued as follows.

# mkfs -t ext3 /dev/hda5
# mkfs -t ext3 /dev/hda6
# mkfs -t ext3 /dev/hda7

All worked without complaint.

Actually It was already running on "init 1" We can omit step 1. above after reboot and let the PC boot automatically. The it will boot into "init 1" finally.

6.
# cp -ar /home2/* /home/
Another trick happened here. It seemed copying all data back to /home. The Hard Drive was working with the pilot light on.

# mkdir /mnt/LFS
# mkdir /mnt/LiveCD

7.
Edited /etc/fstab

Original /etc/fstab before editing;
# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/hdd /media/cdrom auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0
/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0

Changed
LABEL=/home /home ext3 defaults 1 2
to
/dev/hda5 /home ext3 defaults 1 2

Added:
/dev/hda6 /mnt/LFS ext3 defaults 1 2
/dev/hda7 /mnt/LiveCD ext3 defaults 1 2

/etc/fstab after editing;
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda5 /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/hda6 /mnt/LFS ext3 defaults 1 2
/dev/hda7 /mnt/LiveCD ext3 defaults 1 2
/dev/hdd /media/cdrom auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0
/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,fscontext=system_ubject_r:removable_t,managed 0 0
Reboot the PC again

PC rebooted without problem to Login screen. I was not allowed to login as user �satimis� saying /home/satimis/ not found. But I was allowed to login as Root

After login as Root I discovered /home being empty. After copying all files from /home2 back to /home. Login and relogin. This time I was allowed to login as "satimis"

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

Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2563    20482875   83  Linux
/dev/hda3            2564        2690     1020127+  82  Linux swap
/dev/hda4            2691        4865    17470687+   5  Extended
/dev/hda5            2691        3907     9775521   83  Linux
/dev/hda6            3908        4637     5863693+  83  Linux
/dev/hda7            4638        4865     1831378+  83  Linux
# df -hT
Code:
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hda2     ext3     20G  6.3G   12G  35% /
/dev/hda1     ext3     99M   14M   80M  15% /boot
none         tmpfs    125M     0  125M   0% /dev/shm
/dev/hda5     ext3    9.2G  1.4G  7.4G  16% /home
/dev/hda6     ext3    5.6G   44M  5.2G   1% /mnt/LFS
/dev/hda7     ext3    1.8G   35M  1.6G   3% /mnt/LiveCD
Comments are appreciated. TIA

B.R.
satimis
 
Old 06-02-2005, 12:09 PM   #18
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Next time provide ALL output in [CODE] tags.
All the rest is good
 
Old 06-02-2005, 12:51 PM   #19
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The reason the copy didn't work as expected is because you didn't have hda5 mounted on /home when you performed the first copy.

This means that you probably have a copy of your /home data on hda2 under /home as well as on the / of hda5.
 
Old 06-02-2005, 08:52 PM   #20
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi kornerr,

Tks for your comment

Quote:
Next time provide ALL output in [CODE] tags.
OK

Besides I have been searching for a simple and effective method to copy all output and typing (keying in) to a file while working on "text mode" (init 1/init 3) instead of applying;

# command > /home/user/filename
# command >> /home/user/filename

OR using the stupid way to copy all output and typing with pen.

Furthermore would it be more suitable to create other mount points for hda6 and hda7 instead of using /mnt/

e.g.
as Super Root
rmdir /mnt/LFS
rmdir /mnt/LiveCD

# mkdir /LFS
# mkdir /LiveCD

and edit /etc/fstab as
....
/dev/hda6 /LFS ext3 defaults 1 2
/dev/hda7 /LiveCD ext3 defaults 1 2

Please advise. TIA

B.R.
satimis
 
Old 06-02-2005, 09:03 PM   #21
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi david_ross,

Quote:
.......This means that you probably have a copy of your /home data on hda2 under /home as well as on the / of hda5.
Sorry No.

I checked /home after login as Root. It was an empty directory. I copy /home2/* /home/ again. Then the whole system work.

B.R.
satimis


Folks,

One further advice. I have all steps written down in details on a file as guidance before starting repartition. I think it may assist other folks on the forum if they need the steps for reference. Please advise where shall I post the file on Internet.

satimis
 
Old 06-05-2005, 01:11 PM   #22
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Quote:
Originally posted by satimis
Hi david_ross,

Sorry No.

I checked /home after login as Root. It was an empty directory. I copy /home2/* /home/ again. Then the whole system work.
The reason it was empty is because you were looking at the / directory of hda5 and not the /home directory of hda2. Like I said - hda5 was only mounted after you rebooted.

Take a look at the size differences in your df output:
Code:
        Filesystem    Type    Size  Used Avail Use% Mounted on
BEFORE: /dev/hda2     ext3     20G  3.6G   15G  20% /
AFTER:  /dev/hda2     ext3     20G  6.3G   12G  35% /
If you are ever looking for more room on hda2 then just unmount hda5 and once you are sure it was successful "rm -rf /home/*"
 
Old 06-05-2005, 09:38 PM   #23
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi david_ross,

Tks for your advice.

Quote:
The reason it was empty is because you were looking at the / directory of hda5 and not the /home directory of hda2. Like I said - hda5 was only mounted after you rebooted.
After reboot. I was not allowed to login as "satimis/user". I started "Konqueror/home" after login as Root. I fouund /home was empty. Then I copy back the data from /home2 back to /home.

Logout and relogin as "satimis/user". This time I was allowed to login as "satimis"

I'm not very clear whether the abovementioned /home was in /dev/hda5 or /dev/hda2

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

Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2563    20482875   83  Linux
/dev/hda3            2564        2690     1020127+  82  Linux swap
/dev/hda4            2691        4865    17470687+   5  Extended
/dev/hda5            2691        3907     9775521   83  Linux
/dev/hda6            3908        4637     5863693+  83  Linux
/dev/hda7            4638        4865     1831378+  83  Linux
# df -hT
Code:
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hda2     ext3     20G  6.3G   12G  35% /
/dev/hda1     ext3     99M   14M   80M  15% /boot
none         tmpfs    125M     0  125M   0% /dev/shm
/dev/hda5     ext3    9.2G  1.4G  7.4G  16% /home
/dev/hda6     ext3    5.6G   44M  5.2G   1% /mnt/lfs
/dev/hda7     ext3    1.8G   35M  1.6G   3% /mnt/livecd
/home2 is still there. I expect to clarify my doubt before deleting it.

B.R.
satimis

Last edited by satimis; 06-05-2005 at 09:39 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
Repartition problem dstjames Linux - Newbie 1 10-18-2005 08:57 AM
Repartition question satimis Linux From Scratch 5 10-07-2004 03:23 PM
Repartition went fine, now what? aryden Linux - Newbie 3 09-26-2003 05:20 AM
How to repartition Manny88 Linux - Software 2 09-19-2003 03:26 PM
Reinstall or repartition? jane207 Linux - Software 6 11-07-2001 10:30 PM

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

All times are GMT -5. The time now is 06:50 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