Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
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 && ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778

    Hard drive repartition finished


    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 390: 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 463: 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_u:object_r :removable_t,managed 0 0
    /dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_u:object_r :removable_t,managed 0 0
    /dev/fd0 /media/floppy auto pamconsole,exec,noauto,fscontext=system_u:object_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_u:object_r :removable_t,managed 0 0
    /dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_u:object_r :removable_t,managed 0 0
    /dev/fd0 /media/floppy auto pamconsole,exec,noauto,fscontext=system_u:object_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

  2. #12
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    Well done, satimis! Hopefully, you have recognized that the "tricky" parts were simply due to not doing things in the best sequence, but you eventually got everything done. After rebooting, I think the system was unhappy with trying to mount the unformatted hda5 as fstab wanted. Similarly, if you had simply commented ('#') the hda5 line in fstab, there would not have been a complaint.

    My only suggestion from here would be to find a different place to mount LiveCD and LFS. I think the preference is to reserve /mnt/ for mounting of filesystems not mounted at boot. You could as well create a mount point under your home directory or elsewhere. But it's your system and there is no problem with how you have it.

    Cheers~
    /IMHO
    //got nothin'
    ///this use to look better

  3. #13
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778
    Hi drakebasher,

    I still can't understand on step 6. in my previous posting

    6.
    # cp -ar /home2/* /home/
    nothing has been copied to /home. Therefore on reboot I was not allowed to login as "satimis" complaining unable to find /home/satimis.

    However I was allowed to login as Root. But under the /root and /home directories both were empty. Then I copied /home2/ back to /home again. On next reboot the PC worked normal again.

    After rebooting, I think the system was unhappy with trying to mount the unformatted hda5 as fstab wanted. Similarly, if you had simply commented ('#') the hda5 line in fstab, there would not have been a complaint.
    Here is another tricky part /etc/fstab

    Original entry
    LABEL=/home /home ext3 defaults 1 2

    I tried following entries
    LABEL=/home /dev/hda5 ext3 defaults 1 2
    LABEL=/dev/hda5/home /home ext3 defaults 1 2
    LABEL=/home /home ext3 defaults 1 2
    without result. PC failed to boot.

    Only following entry work.
    /dev/hda5 /home ext3 defaults 1 2

    My only suggestion from here would be to find a different place to mount LiveCD and LFS...
    Whether as Super Root
    # mkdir /LFS
    # mkdir /LiveCD

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

    B.R.
    satimis

  4. #14
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817

    Re: Hard drive repartition finished

    Quote Originally Posted by satimis
    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.
    Unless you left a step out of your narrative, it appears that /dev/hda5 was not mounted at /home, but that should not have kept you from writing to the root partition under the /home/ directory, so I too am puzzled there. As for the /root/ directory (root's home), there should not be much there, if anything (well, I guess there should be something).

    Only following entry work.
    /dev/hda5 /home ext3 defaults 1 2
    I should have mentioned something here. This seems to be peculiar to Fedora and occaissionally creates confusion: with the command 'e2label' you can set or check the "label" of any partition. You could label /dev/hda5 "foobar" and then the applicable line in fstab could be either 'LABEL=foobar' or '/dev/hda5'. I think this is useful if you sometimes change drives like in a file server. I prefer the direct '/dev/hda5' syntax because I know where it applies and how, and it is not distro-specific.

    One additional note: in the cp command, when the -a switch is used, I think the -r switch is redundant. I like to use the -v switch as well so I can watch all my files go where they belong!
    /IMHO
    //got nothin'
    ///this use to look better

  5. #15
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778

    Re: Hard drive repartition finished

    Hi drakebasher,

    One additional note: in the cp command, when the -a switch is used, I think the -r switch is redundant.....
    Noted with thanks

    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

  6. #16
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    There is a collection of tutorials in these forums, gotten to by the "Linux Tutorials" link in the header bar next to "Linux Forums". I'm sure that if you posted your notes to the "Comments / Feedback / Suggestions" forum, perhaps with a subject of "Submission for Tutorial" or something similar, it would get prompt attention. I'm sure others will appreciate your efforts to share what you know, as I appreciate them.
    /IMHO
    //got nothin'
    ///this use to look better

  7. #17
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778
    Hi drakebasher

    ......posted your notes to the "Comments / Feedback / Suggestions" forum, perhaps with a subject of "Submission for Tutorial" or something similar.....
    I found it.

    My notes is quite complete including the steps in booting to "init 1" the Single User Mode.

    However I have one point to consider. Whether to post all having been ecountered here such as;

    # cp -ar /home2/* /home/
    without result and need to recopy them the second time after login as Root.

    Any suggestion

    B.R.
    satimis

  8. #18
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    If it was me, I'd include the step, along with a statement of what you expected and what you got, making clear that it's an open question. The reader will then be able to make his own choices with eyes open, and ideally, someone may even discover where to error is so that you could then correct your material. I've read through quite a few tutorials, mostly from The Linux Documentation Project (they have an expansive collection: tldp.org) and this sort of problem, though usually at a more esoteric level, is not at all unusual. I guess we are all newbies at some level.

    Kind regards~
    /IMHO
    //got nothin'
    ///this use to look better

  9. #19
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778

    Document submitted

    Hi drakebasher,

    Document submitted to -> Linux Forum -> The Community -> Comments/Feedback/Suggestions

    B.R.
    satimis

Page 2 of 2 FirstFirst 1 2

Posting Permissions

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