DELETE & EXPAND PARTITIONS

Asked by John Rosing

I want to delete two existing partitions containing containing UBUNTU 9.4 ON EACH, and subsequently re-install UBUNTU from a CD. I alluded to this in my former question #81166, asked on 2009-08-28. In that answer I was requested to search for “sudo fdisk -l” which I did and received the following information:

DEVICE BOOT START END BLOCKS ID SYSTEM

/DEV/SDC 1 1 17811 143,066,826 7 HPFS/NTFS

/DEV/SDC 2 17812 19457 13,221,495 5 EXTENDED

/DEV/SDC 5 19132 19435 2,441,848 83 LINUX

/DEV/SDC 6 19436 19457 176,683 82 LINUX swp/solaris

/DEV/SDC 7 19812 19069 10,104,822 83 LINUX

/DEV/SDC 8 19070 19131 497,983+ 82 LINUX swp/solaris

I was able to enter the PARTITION EDITOR when operating UBUNTU 9.4 from the CD but not from copy 2 of the installed program (presumably “/DEV/SDC 7” above). Then when I entered the PARTITION EDITOR I was not able to find this partition but only the first one (/DEV/SDC 1). This was in step 4 of 7 and then I quit.

What can you recommend?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
zvacet (ivicakolic) said :
#1

Download Gparted live CD from http://gparted.sourceforge.net/ and with it delete all partitions except sdc1(I believe you want your Windows).On that unallocated space install Ubuntu.I think it is good idea to make separate home,because with it you can do reinstall,fresh install and your data/files will be safe.And you wil have just one swap.

Revision history for this message
Tom (tom6) said :
#2

Hi

The previous question's thread being here
https://answers.launchpad.net/ubuntu/+question/81166

When Ubuntu installs onto a hard-drive it doesn't install the partition editor because you really need to run gparted from a LiveCd usually. It would be like standing on a rug and trying to drag the rug across the room - much easier if you're not standing on the rug.

When you say that the "fdisk" command gave those partitions as being on sdc rather than sda or sdb it suggests the 3rd physical hard-drive on your machine.

In the partition editor you can reach that drive by clicking the button at the top right-hand corner. The button probably says something like "/dev/sda 20GiB Media" when you click on the button it becomes a drop-down list which should allow you to select /dev/sdc and then you'll see all those partitions.

To get to partitions sdc5 and sdc7 through nautilus (the file-browser) go up to the top taskbar and click on "Places". Sdc5 and sdc7 will be in that menu as 'removable media" and probably called helpful things like "10.4 GiB Media", slightly less than whatever the Partition Editor values them at i think. Navigate into the /home/username folder on each partition. Just copy all the data you want to keep from those folders onto the Windows partition, sdc1.

I would then delete all the partitions including sdc2 but leaving sdc1 untouched of course. Then create partitions like this

sdc1 unchanged or maybe just resized a bit
sdc2 2xRam Primary Partition, 'file-system' = linux-swap
sdc3 6Gb Primary Partition, filesystem = ext3 or ext4
sdc4 Extended Partition filling the rest of the drive
 . sdc5 10Gb Logical Partition, filesystem = ext3 or ext4

Note that sdc5 is contained inside sdc4. If there's enough space it would be nice to make an sdc6 of 5Gb for trying out other versions of linux or for generally experimenting with. Sdc5 is for using as a separate /home partition for keeping all your data safely off the partiiton your main OS is installed onto. That will be sdc3, it doesn't really need to be any larger than 4Gb but if you have got the space then giving it plenty of elbow room seems quite sensible. Note that sdc5 is where all your data is going to be stored, unless except the stuff you keep on the Windows partition.

To find out how much ram you have type this into the command-line

free -m

Then it's easy to work out roughly how large to make your linux-swap partition.

Note that when you start deleting partitions it's usually a lot easier to start deleting the highest number first - so delete sdc8 first. Finally click on the "Apply" button when you're fairly sure.

Good luck and regards from
Tom :)

Revision history for this message
John Rosing (rosingj) said :
#3

Thank you, but I am still stuck. I was able to get to the partition editor and select partitions to get their information but not the ability delete them, i.e.:
SDC 1 > 136.44 GiB
SDC 2 > 12.61 GiB
SDC 5 > 2.33 GiB
SDC 6 > 172.54 MiB
SDC 7 > 9.64 GiB
SDC 8 > 486.31 MiB

Yes I would like to delete them but I don't know how. When I click on "Places" I do not see
SDC 5 or SDC 7 but disk and vol.

I assume that I would then create the partition while installing UBUNTU from the live CD.

???? John

Revision history for this message
Tom (tom6) said :
#4

HI :)

During the install you can either allow the installer to decide for itself how to layout your partitions or you can choose "manual partitioning". I prefer the "manual partitioning" route to tailor the set-up better to maximise speed and reliability for the particular machine. It is during this part of the installer that you set the "Mount Points" of the partitions to things like "/" and "/home".

The output of the command

free -m

would be really useful at this point because until we get that result our answers are likely to be less than perfect or a bit unclear.

The "Places" menu does annoy me too. It used to make sense in the way you expected but now it tries to make things easier the poor ex-Windows user by naming things differently from the way it names them in the rest of the system. In the "Places" menu look for an icon that look like a hard-drive and is labelled something like "9.3 Gib Media". This is will approximately the value that "Places" will see your sdc7 as being. The problem about quoting figures for GB and Mb is that machines do not count in decimal, they count in 1's and 0's. For machines 1,000 is fairly useless number since they see that as 1111101000 however the number 1024decimal = 10000000000 binary which is a much more interesting to a machine. So when a human says 1Gb they might mean 1,000Mb which might mean 1,000Kb which might mean 1,000bytes but for a machine you could more usefully replace all of those with 1,024 rather than 1,000. Invariably we do a mix of both. A new standards got introduced with an "i" in the middle (GiB, Mib and so on) to make it clear that the standards is being used. Unfortunately it's unclear exactly what the standards means and many people are unaware of the issue. So precise measurements taken by one program often vary considerably when looked at from a different program & salespeople will often do almost anything to make their machine sound better than it is. So, good luck with that "Places" menu, the exact value given to sdc7 is unclear but it will be something like "9.3 GiB Media" or "10.1 GiB Media". Luckily the only partition that is close to the same size is the Extended Partition which wont show up in the Places menu anyway. I don't know why it is made this awkward and clunky now.

Once you find sdc7 then you will find a lot of folder such as /bi, /boot, /dev, /home. It is inside the /home folder that all your data is contained for all the users on your system. If your machine only has 1 user then there will only be one folder in /home and that will have the same name as your username. You should have no trouble copying the entire /home folder onto sdc1 which should show up in the "Places" menu as something like 125 GiB Media" lol.

At last! To delete sdc8 you might first need to either "umount" it or do "swap-off". Since it happens to be a linux-swap partition try right-click on it and in that menu should be "Swap Off". For sdc7 it will give the option to "umount". Each time you do one of these actions GPartEd has to rescan the drive which takes quite some time but it's still easier to umount or swap-off from here at first. Then deleting each partition should be fairly easy as long as you start with the highest value partition; sdc8, then sdc7, then sdc6 - and so on until only sdc1 remains. It would be really good if you could resize sdc1 down to leave something like 25Gb free empty grey space at the end of the drive ready to set-up some good partitions for Ubuntu.

Good luck and regards form
Tom :)

Revision history for this message
John Rosing (rosingj) said :
#5

WOW!! Everything worked as I expected to delete the partitions and resize sdc 1. I really appreciate the effort that you have taken to try to help me with this. I deleted the partitions sequentially 8, 7, 6, 5, 2. I then installed UBUNTU during which I resized the existing space to a new size of 100122 MiB for WINDOWS leaving a free space of 52503 MiB. The system reported that the device ScSl1 (0,0,0) (SDA) was changed and that partitions #5 and #6 were created as EXT3 and SWAP respectively.

BUT: I now have two new problems >

I can not get into the newly created UBUNTU because it does not accept my name / and or / password. I know that I used a password that I remember and used to log in here. But I don't remember the exact log in name in the install setup. I tried a variety of combinations none of which worked. Is there any way to overwrite this from this live CD?

My second problem is even more severe. I can not open WINDOWS. It doesn't like the partition change and is asking me to run "CHKDISK /F". Unfortunately I have no command prompt to run it when this is reported on a "blue" screen. I have downloaded a new version using another computer and copied it to a floppy.

So at this point I only have this live CD copy of UBUNTU, and I am glad that I was able to figure out how to get to this "question", 81355 on this OS.

I am a patient man and willing to try any suggestions. Incidentally I did run "free -m" which gave me the following results:

MEM:

Revision history for this message
John Rosing (rosingj) said :
#6

NO. i ACCIDENTALLY PUSHED THE WRONG BUTTON.
                         TOTAL USED FREE SHARED BUFFERS CACHED
MEM 1997 561 1435 0 21 273
-/+ BUF/CACH 208 1789
SWAP 658 0 658

Revision history for this message
John Rosing (rosingj) said :
#7

Please let me know if you need this memory information correctly ?

Revision history for this message
Tom (tom6) said :
#8

Hi :)

Before taking any advice in this post please get to a command-line
https://help.ubuntu.com/community/UsingTheTerminal#Starting%20a%20Terminal
and type in

sudo fdisk -l

where " -l" is a lower-case " -L" and just check that sdc1 is still an hpfs/ntfs file-system. The error message from Windows about chkdsk has me a little worried about a couple of things that could have gone wrong so please check that first and if it isn't then we really need to use some data-recovery techniques
https://help.ubuntu.com/community/DataRecovery

From the LiveCd you can access the data on your Windows partition of course. Also this guide
http://www.psychocats.net/ubuntu/resetpassword
might help you access your hard-drives Ubuntu but really i think we should try again with partitioning. If we do need to do data-recovery stuff then just stick to using LiveCd sessions until we sort that out.

Another thing is that most distros can check a Windows partition using "fsck" which is the linux equivalent of "chkdsk" but i wouldn't do this with Ubuntu. Note that when you get to a command-line you can add a tag "-h or "--help" after a command to get a quick guide cheat-sheet on how to use the command. This can help you verify the validity of commands you get told to run before running them, especially good for most forums out there although in here i've never seen anyone give really bad advice and certainly nothing deliberate. As an example try

fsck -h

and note that while there's ext3 support there's nothing about ntfs. That functionality can easily be added but that's another story ;)

The memory info looks about right for your Ram, showing 2Gb of Ram but the automatically created swap should be at least equal to that preferably a bit more. Ideally we want swap to be a tiny little over 2xRam so that when you get a ram upgrade you still have plenty. A quick glance at this guide, the hibernation section
https://help.ubuntu.com/community/SwapFaq

Ok, so to tailor your partitions to try to get the most speed & reliability from your machine with the least hassle i think this layout would be best

sdc1 no change
sdc2 4.5Gb Primary Partition, 'file-system' = linux-swap
sdc3 10Gb Primary Partition, file-system = ext3 or ext4
sdc4 Extended Partition to fill the rest of the drive
 . sdc5 to almost fill sdc4, Logical Partition, file-system = ext3 or ext4
 . sdc6 10Gb Logical Partition, file-system = ext3

Then during the install in the "Partitioning Section" choose "Manual Partitioning" which will help to edit the "Mount Points" of each partition to this

sdc1 no change,
sdc2 Mount Point = none, it's done automatically
sdc3 Mount Point = /
sdc4 Mount Point = none, it's done automatically
 . sdc5 Mount Point = /home
 . sdc6 Mount Point = none, this is a sandbox area to use for experimenting with distros other than Ubuntu and/or for testing settings for Ubuntu before using them in your main install or for testing 9.10 when that reaches beta test status.

Note that for sdc3 it's / and for sdc5 it's /home and also notice that the first character in /home is the root of the linux file-structure. All the folders build up from / but the /home folder is the only one that contains normal users data that often needs protecting during install of an OS. Normally if you want to back-up all your data you simply copy the entire /home onto an external drive or something, if you have the space otherwise you have to settle for either compressing it all or just picking out the crucial data.

Also notice that in the "Manual Partitioning Section" there's a tick column titled "Format?". Please make sure that all partitions are UNticked, except sdc3 & sdc2. When you format a partition all the data on it gets wiped out and we definitely don't want that to happen with most partitions on your system.

I hope this helps you re-install to get all this sorted out!
Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#9

Hi again :)

Just to check that when you run the Ubuntu installer you run it from the icon on the desktop of the LiveCd session. This then allows you to play a simple light-weight game while waiting for various installer stages to complete - although these days most of the questions are right at the very start and any others are right at the end with only a couple of very short processes taking place after them. So once the installer has gone past the "Summary Section" and you have checked that nothing is going to get formatted except sdc2 & sdc3 then you can leave the machine to get on with the install on it's own :) The crucial benefit is in being able to access help on the internet if there's any doubt, just to bolster confidence if nothing else.

Good luck and regards from
Tom :)

Revision history for this message
John Rosing (rosingj) said :
#10

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb2d7b2d7

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 10644 85497898+ 7 HPFS/NTFS
/dev/sda2 10645 14593 31720342+ 5 Extended
/dev/sda5 10645 14425 30370851 83 Linux
/dev/sda6 14426 14593 1349428+ 82 Linux swap / Solaris

Disk /dev/sdb: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0679f6f1

   Device Boot Start End Blocks Id System
/dev/sdb1 1 9733 78180291 7 HPFS/NTFS

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1d3a15c0

   Device Boot Start End Blocks Id System
/dev/sdc1 1 12764 102526798+ 7 HPFS/NTFS

Disk /dev/sdd: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x0022ae1e

   Device Boot Start End Blocks Id System
/dev/sdd1 1 20673 156287848+ 7 HPFS/NTFS
ubuntu@ubuntu:~$

Revision history for this message
John Rosing (rosingj) said :
#11

I have some difficulty following your suggestions. i.e. I don't know how to create the partitions. Consequently I used the installer to do it for me. The data above is what is reported when using "sudo fdisk -l".

When I look at /dev/sda1 - GParted I see the following:

/dev/sda1 ntfs DSK1_VOL1 size 81.54 GiB used 26.68 GiB unused 54.86 GiB boot
/dev/sda2 extended size 30.25 GiB
      /dev/sda5 ext3 size 28.96 GiB used 7.50 GiB unused 21.46 GiB
      /dev/sda6 linux-swap size 1.29 GiB

When I look at /dev/sdb - GParted I see the following:
      /dev/sdb1 ntfs DSK2_VOL1 size 74.56 GiB used 46.58 GiB unused 27.98 GiB

When I look at /dev/sdc - GParted I see the following:

/dev/sdc1 ntfs DISK 4_VOL1 size 97.78 GiB used 23.86 GiB unused 73.92 GiB
unallocated size 51.27 GiB

When I look at /dev/sdd - GParted I see the following:

/dev/sdd1 ntfs DISK5_VOL1 size 149.05 GiB used 93.42 GiB unused55.63 GiB

Revision history for this message
John Rosing (rosingj) said :
#12

after running "fdisk -l" I tried to open the WINDOWS OS. with the same failure mode.

All this seems to me that the boot takes place on sda1 not sdc1. I hope that this info provides you with more insight as to what is going on on this computer. this error correction process is somewhat cumbersome to me since when I close the live CD OS try something on the HDD and then go back to the live CD OS all history of the previous session is lost and I have difficulty to re-establish the question. When I try to find question 81355 I get the answer that it does not exist. Then I search all the questions to find it again.

Also the question is really not "solved" although I accidentally marked it as such. Can that status be changed back to "I still need an answer" ?

Revision history for this message
Tom (tom6) said :
#13

Hi :)

Yes, again working backwards. This thread can be marked as "Open" by clicking on the button underneath where you type comments into the thread. At the moment you always seem to click on the button "That answered my question" rather than the one beside it which says "I still need an answer". However the main advantage of doing that is a little lost because quite a lot of people do that so i just respond when you post something. Also this question is so old now that no-one else is likely to read it whatever the status of it is. Launchpad does not have a good way of dealing with older questions. You can always post a new question
https://answers.launchpad.net/ubuntu/+addquestion
or at
http://www.linuxquestions.org
which is a more general linux forum rather than specifically Ubuntu. I haven't tried many forums but that seems about the best i have seen. there is another Ubuntu forum that seems excellent but i keep losing the links to it. Also this guide might help as it also has a search feature up at the top right-hand corner
https://help.ubuntu.com/community/Signpost/Questions#help

'Good' news and bad news about partitioning and your drives. Yes, ubuntu is now installed on sda and the Windows on that drive is probably "C:", sdb and sdd both remain just as you have always had them but sdc probably needs some TLC. Presumably you now have the option of booting into Windows and that should work? If so then just do the chkdsk on sdc "Disk4" from inside Windows. I would guess that things like "scan disk" or "defragment" would include a chkdsk step in their processes? Even if they don't then it makes sense to do those things later. While Ubuntu is not set-up perfectly on sda and we may not have wanted it there it should work and should be giving you dual/multi-boot options for booting into Windows? If ubuntu is able to boot up to a working desktop from sda then we can do things from there for a while instead of using the LiveCd. Sorry i didn't detail about partitioning, you seemed to have that all under control and seemed to be doing it quite well!

So, please let me know if you can boot into Windows and if Ubuntu is working without booting from the LiveCd?

Good luck and regards as always from
Tom :)

Revision history for this message
Tom (tom6) said :
#14

Errr, i have to sleep so hopefully just use synaptic
https://help.ubuntu.com/community/SynapticHowto
to install gparted into the ubuntu on your hard-drive. Then gparted should be able to help add partitions to sdc. It wont be ale to do anything to sda but i would leave sda as is until after completing the plan for sdc?

Revision history for this message
John Rosing (rosingj) said :
#15

Thank you for your response. I too had to go to sleep.

Here is an up date of what I experienced last night:

Yes I can dual boot.

Yes I can boot into UBUNTU but I can not open because I can't get past the "user sign in"

Yes I can start to boot into windows but it is still corrupted and gives me a blue screen explanation asking me to run "CHKDISK /F" I presume that the "/F" means "fix" and I don't know exactly how to do that from within live CD UBUNTU.

Since I now have no working computer either WINDOWS or UBUNTU I thing it prudent to get UBUNTU working first. Now I have lost the link to attempt the sign-in override. Could you please resend it.

Now I will click "I Still Need Answer"

bye

Revision history for this message
Tom (tom6) said :
#16

Right, thanks for the update. I got a bit lost there. I think the quickest plan is to get the ubuntu that is already on sda sorted out. This guide should help sort out the password and login
http://www.psychocats.net/ubuntu/resetpassword

Revision history for this message
Tom (tom6) said :
#17

Hi again.

I wouldn't worry about sdc unless you are really pushed for space. I found it took a few times of installing a couple of linux distros before i really got to grips with installing it. Also i ended up tweaking so many things that it broke a few times and due to my inexperience and shyness of using forums i had to reinstall a few more times. It's quite handy to have a space like you have on sdc where you can make a decent install after you have done a bit of experimenting.

Ideally it would be great to just get sda working and then maybe do a decent stable install on sdc so that you can experiment with one and keep the other one safe :)

Please let me know when you've managed to use the guide to find the username on sda and been able to reset the password.

Regards from
Tom :)

Revision history for this message
John Rosing (rosingj) said :
#18

Tom:

Thank you. Yes the link did work. I was able to become a user, download all 218 updates, but still can not get any mail. I started a new question about that. Now I have discovered that I can get to this chain by entering "https://answers.launchpad.net/ubuntu/+question/81355" which worked very well.

I now have a functioning computer using UBUNTU (however without email). All these postings are normally echoed to my email. Obviously I can't see them and therefore depend on this mechanism to communicate with you.

while I am waiting for an answer to my e-mail question I want to try restore my WINDOWS OS. I somehow need to run "CHCKDISK /F". I hope that you can give me a clue.

Regards
John :-)

Revision history for this message
Tom (tom6) said :
#19

Hi :)

I would really rather do that "CHKDISK /F" from inside Windows if possible. Before try it please try seeing if you can access the data and copy it to either external drive, or into the ubuntu Documents folder or onto Dvd or something. If you only have space for certain critical files such as family photos and stuff then just copy the critical ones. Hopefully they wont need to be there for long as it is just precautionary. I tend to find things like this only go wrong if i haven't made a backup ;)

If you have a Windows Recovery Disk
https://help.ubuntu.com/community/WindowsDualBoot#Getting%20Recovery%20Media
or a Windows Installer Cd (Xp or later) then this 'should' be fairly easy from the recovery mode when you try to use the Cd as a LiveCd. A Windows normal safe boot Cd should be ale to get you to a command-line
Start - All Programs - Accessories - System Tools
something like that usually has an "MsDos" icon or something.

A cheeky way of trying this is to either take the physical drive out of your current machine and plug it into another machine as slave (check the jumpers between the data cable and power socket, compare with legend on top or bottom or scratched into the same end of the drive). Then bootup the other machine and run "chkdisk /f" from there. (After it has "Found new hardware"). Alternatively just change the jumper setting to slave but kep it in the same machine and grab a drive from another machine to boot up your own machine. This route has slightly less chance of working because Windows installed on the hard-drive of one machine can't handle booting a different machine very well although they survive the experience and can usually just about cope with all the new hardware.

If you really have to do this from inside linux then i would recommend using something other than Ubuntu as a LiveCd. If you have to use Ubuntu then please use Synaptic Package Manager
https://help.ubuntu.com/community/SynapticHowto
to search for and install "ntfs-3g" and "ntfsprogs" before trying this. Ok, so whichever distro you are using get to a command-line and type in

fsck -h

to get a quick help cheat-sheet on how to use the fsck command to do the work.

I think it would be best tho to ask a new question in a couple of places about how to do the equivalent of "chkdisk /f"
https://answers.launchpad.net/ubuntu/+addquestion
http://www.linuxquestions.org
and whoever gives the best answer first just copy the link into the other one's thread. I am pretty sure my method will work but i would seriously consider getting a second opinion on that.

Good luck and regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask John Rosing for more information if necessary.

To post a message you must log in.