LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-12-2011, 03:58 AM   #1
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Rep: Reputation: Disabled
repartition a hdd


Hello,

I have Three disks installed, one SATA and two SCSI disks.

SCSI1: boot + RHEL3
SCSI2: home
SATA: RHEL5

I want to create an extra partition on the SATA disk without re-installing RHEL5. Is this possible?

Thank you for your response.

$ df
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1            236545184  17536500 206798884   8% /
/dev/sdc2             68539636   2001484  63056468   4% /users
/dev/sdb1               101089     26852     69018  29% /boot
/dev/sdb3             68437272  40142304  24818504  62% /RHEL3U7
$ more /proc/partitions
Code:
major minor  #blocks  name

   8     0  244198584 sda
   8     1  244196001 sda1
   8    16   71687369 sdb
   8    17     104391 sdb1
   8    18    2048287 sdb2
   8    19   69529320 sdb3
   8    32   71682030 sdc
   8    33    2048256 sdc1
   8    34   69633742 sdc2
fstab
Code:
LABEL=/1                /                       ext3    defaults        1 1
LABEL=/home             /users                  ext3    defaults,usrquota        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
LABEL=/                 /RHEL3U7                  ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sdb2               swap                    swap    defaults        0 0
/dev/sdc1               swap                    swap    defaults        0 0
 
Old 01-12-2011, 04:15 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello,

it seems /dev/sda is the SATA-device. There seems to be much free space on the device. You may look at the program gparted http://gparted.sourceforge.net/ which manages resizing of partitions.

You'd be better off in future if you use the df command with the -h option. The -h option translates the byte-values to GB which is much more readable.

Markus
 
1 members found this post helpful.
Old 01-12-2011, 08:30 AM   #3
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Original Poster
Rep: Reputation: Disabled
Dear markus,

Thank you for mentioning gparted.

I prepared a different system with the same kind of setup as mentioned above and I have successfully added an extra partition.

Now I have to figure out how to remove the disk containing the RHEL3 and boot partitions and boot from the RHEL5 disk containing the RHEL5 and the new boot partition.

After reboot the newly created partition is not yet mounted.

Code:
major minor  #blocks  name

   8     0  143374744 sda
   8     1  141224672 sda1   
   8     2    2048256 sda2   
   8     3      96390 sda3   # newly created partition labeled "/boot"
   8     0  143374744 sdb
   8     1     104391 sdb1   # original partition labeled "/boot"
   8     2   92068515 sdb2
   8     3   51199155 sdb3
This means that the content of the original "/boot" partition should be copied to the new "/boot" partition.
Next to that, the partition should be mounted automatically.

Should I use "dd" and alter the "fstab" file?
 
Old 01-12-2011, 09:39 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
No, I wouldn't do this with dd. I think it wouldn't work at least because the old and new partitions have different sizes. cp with the -p (preserve) option will copy without changing the permissions.
Be sure to format the newly created partition.

In order to boot from another partition you'll have to adapt the bootloader.

Markus
 
Old 01-12-2011, 10:11 AM   #5
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Original Poster
Rep: Reputation: Disabled
So, I have to re-install grub?
 
Old 01-12-2011, 10:22 AM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
You'll have to edit the /boot/grub/menu.lst file and change the partitionentries there. As you know grub is installed on the masterbootrecord (MBR) of your /dev/sda, if you had only changed the menu.lst file it would not be necessary to reinstall grub.
But since you moved the /boot directory, I'd assume that you'll have to issue the grub-install command. Grub must "know" where it's menu.lst file resides (roughly spoken).
If you want to install Grub in the MBR of /dev/sdb, you'll have to issue the command
Code:
grub-install /dev/sdb
Now that I'm writing this, I feel, I'm not sure what to do in order to make Grub recognize the new location of it's menu.lst file, I think it's time to read the manpage.

Markus
 
Old 01-12-2011, 01:34 PM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,369

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
There's a zillion threads here on reinstalling grub. Try following them.
 
Old 01-14-2011, 06:07 AM   #8
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Original Poster
Rep: Reputation: Disabled
I created a live usb disk of fedora 14 to do the reinstallation of grub.

After doing a small modification in the grub.conf file, the system booted again.

Thank you for you support.
 
  


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 Off
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 - General 22 06-05-2005 09:38 PM
Repartition hd for WinXP mpn Linux - General 1 11-27-2004 12:59 AM
How to repartition Manny88 Linux - Software 2 09-19-2003 03:26 PM
anybody, pls help me in repartition of my HDD deepakchopra Linux - Newbie 1 09-14-2001 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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