LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-22-2009, 07:44 AM   #1
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Rep: Reputation: 67
repartitioning


Hello,
Can I get some advice about repartitioning while keeping my current installation?

My current partition scheme is:
/dev/sda1 40GB ext3 (12.2 installation)
/dev/sda2 20GB ext4 (13.0 installation)
/dev/sda3 80GB ext3 (data)
/dev/sda4 2GB swap
They are all primary partitions. What I'd like to do is get rid of the 12.2 partition and use it to mount a /home partition of perhaps 5GB and then leave the rest for whatever I may want to do with it, such as testing a new distro or version of Slackware.

Can I just delete sda1 and use cfdisk to make two new partitions? What about making them primary or logical? Are there any issues that I should be aware of before going at it?

Thanks, b.
 
Old 10-22-2009, 08:29 AM   #2
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Rep: Reputation: 32
First, format /dev/sda1 as ext4, and mount it to temporary directory under Slack 13. Next, copy /home/* to /dev/sda1, backup this directory for sure and remove all subdirectories from /home (it should be empty directory), and then You can change the stable mountpoint in /etc/mtab for /dev/sda1 to /home directory. All this should be done as root, of course. After next reboot You should have /dev/sda1 mounted as /home with full users directories.

Good luck
 
Old 10-22-2009, 08:34 AM   #3
ajlewis2
Member
 
Registered: Nov 2003
Distribution: Ubuntu
Posts: 218

Rep: Reputation: 46
First be sure that your boot loader is using the 13.0 installation. If not, then make it so. When you installed 13.0, did you request lilo be written to the mbr? If so, then you are good. If not, then you may still be using it from the earlier install. lilo is in my distant memory since I've been using grub for a long time; so maybe it doesn't matter, but check it out before you get rid of your first install.

I think the safest thing to do is to change the partition type to 5 which is extended. Then you can make new logical partitions on it. It's risky to actually delete a partition. In the past I did that and all the partition numbers changed.
 
Old 10-22-2009, 08:35 AM   #4
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Rep: Reputation: 32
After deleting Slack 12 os, You may need to rewrite proper system list for Your's boot loader, so check Your configuration files

Last edited by Martinezio; 10-22-2009 at 08:37 AM. Reason: damn, spelling ;)
 
Old 10-22-2009, 09:10 AM   #5
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Something to be aware of - you currently have four primary partitions. That's the maximum you can have and it must also include any extended partition which may contain many logical partitions. I you wanted to create more partitions where slack12.2 is on /dev/sda1 you will have to delete that then create two (or more) logical partitions in the space it occupied. These will be /dev/sda5 and onwards meaning you will no longer has a /dev/sda1. This is due to the way extended partitions work and limits set into the system. The existing partitons /dev/sda2 - /dev/sda4 should retain their present names OK so you're mountings will be alright left as they are for them.
If you come unstuck with lilo after you have made any changes you can use the install disk to boot into your Slackware 13.0 install and fix things.Lilo should be OK though. However as the other posters point out it's something to watch out for.
 
Old 10-22-2009, 09:26 AM   #6
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
Quote:
Originally Posted by brixtoncalling View Post
Hello,
Can I get some advice about repartitioning while keeping my current installation?

My current partition scheme is:
/dev/sda1 40GB ext3 (12.2 installation)
/dev/sda2 20GB ext4 (13.0 installation)
/dev/sda3 80GB ext3 (data)
/dev/sda4 2GB swap
They are all primary partitions. What I'd like to do is get rid of the 12.2 partition and use it to mount a /home partition of perhaps 5GB and then leave the rest for whatever I may want to do with it, such as testing a new distro or version of Slackware.

Can I just delete sda1 and use cfdisk to make two new partitions? What about making them primary or logical? Are there any issues that I should be aware of before going at it?

Thanks, b.
Install boot-loader for slackware 13.
Probably you can't create more than four primary partition.Create extended partition,then logical partition.
Your partition number may be changed, so you may need to change boot loader configuration.
 
Old 10-23-2009, 03:47 AM   #7
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Thanks for all the responses. I've got some follow-up questions.

First, how do I check where the boot loader is installed?

Second, a couple of posters mentioned that the partition numbers might change... how can I determine if they will? And if they do, it will cause problems not only for the boot loader but also for my fstab, right?

I guess a third question might be, is it just easier to backup and start from scratch??
 
Old 10-23-2009, 05:46 AM   #8
ajlewis2
Member
 
Registered: Nov 2003
Distribution: Ubuntu
Posts: 218

Rep: Reputation: 46
Quote:
Originally Posted by brixtoncalling View Post
Thanks for all the responses. I've got some follow-up questions.

First, how do I check where the boot loader is installed?

Second, a couple of posters mentioned that the partition numbers might change... how can I determine if they will? And if they do, it will cause problems not only for the boot loader but also for my fstab, right?

I guess a third question might be, is it just easier to backup and start from scratch??
Since you aren't sure about the bootloader, boot into version 13.0 and reinstall the bootloader from there. I'm assuming that you are using LILO. In a terminal as root run
Code:
/sbin/lilo
See this for a little more info about LILO http://www.slackbook.org/html/booting.html#BOOTING-LILO

You can't tell if it would change them, but I just found out that you cannot just change the partition type to extended. It must first be deleted. But, you will not be writing the table until you remake the partition; so it will not change the numbers. I use fdisk; so can't give you cfdisk directions, but you delete sda1, then remake it and give it type '5' for extended, then make your logical partitions and then check what the table looks like. With fdisk, that is 'p' to print it out. Then write the table if it looks correct. Be sure to reboot before you do anything with sda5 or 6. It's good to reboot after changing the partition table.

No it is not easier to start from scratch. I'm sorry for the bad information I gave about changing that partition type without deleting it in my previous post. Also I forgot to say that the numbers will not change until the table is written; so remaking paritition sda1 solves the problem.

Edit: Another good thing to know. You can save your original table information and remake a partition table if you find it is broken. Redoing the partition table does not remove your data. So I do this and keep it on hand: fdisk -l > partition-table.txt. I write all those numbers on an index card, too. Then I can rewrite the table with those exact numbers and I actually did this once and was grateful to the one who had told me about it. I don't know how it works with cfdisk.

Last edited by ajlewis2; 10-23-2009 at 05:51 AM. Reason: save the table info first
 
Old 10-23-2009, 07:47 AM   #9
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
You might want to repartition with a Parted Magic lice CD:
http://partedmagic.com/
This is a graphical partition manager that runs off a live CD. If your partitions change after deleting /dev/sda1 it will be shown on Parted Magic. You can then mount and chroot into your Slack 13 partition and change fstab and rerun lilo if you need to all from the Parted Magic live CD.
 
Old 10-25-2009, 12:39 AM   #10
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Thanks for the clarifications. I'm going to have to do a number of backups before I get into this. I'm still wondering if going in by scratch might be better since it'll give me the chance to make some changes that I'd like to have -- such as encrypted partitions for /home and the data that is currently on /dev/sda3.
 
Old 10-28-2009, 03:22 AM   #11
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
For those keeping score at home, I finally did it and wow, was it painless. No need for any concern on my part. I deleted sda1 and made 3 new logical partitions of 18, 18 and 4 gigs. I reinstalled 13.0 on one of the 18s and upgraded to current and made the 4 my /home. The old 13.0 boots fine (ie no partition name changes) so good news all around.
 
  


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
repartitioning metalsam Linux - Software 5 07-02-2006 05:39 PM
Repartitioning fearofcarpet Fedora 3 09-05-2004 02:16 PM
Repartitioning King4lex Linux - Newbie 4 09-02-2004 06:15 PM
help with repartitioning JunLitsu Linux - Software 6 06-24-2003 05:10 PM
Repartitioning Lazlo Linux - General 3 12-11-2001 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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