LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-13-2013, 12:40 PM   #1
s4sarath
LQ Newbie
 
Registered: May 2010
Posts: 22

Rep: Reputation: 0
Resizing Root Partition Urgent


Hi Guys ,

I was installing some packages via apt-get. After downloading, while installing my root size becomes empty.

Now I want to extend my root partition.
All my PG project works are inside that. Please help me. Please.
 
Old 10-13-2013, 01:40 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Please do not title threads as urgent. It isn't urgent for those that volunteer their time to answer questions on the forum. Without knowing how your drives(s) are currently partitioned it is difficult to provide help.

You will need to run gparted from a live CD.

http://gparted.sourceforge.net/livecd.php
 
Old 10-13-2013, 01:42 PM   #3
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
first open a terminal and
Code:
sudo apt-get clean
then delete any unnecessary garbage and reboot.
Next, clone the partition and re-size the copy with partitioning software.
Finally, migrate to the larger partition.
 
Old 10-13-2013, 04:40 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I might be tempted to boot to a live cd/dvd/usb and run testdisk.

Get the data off before you get too far into this.
 
Old 10-14-2013, 03:20 AM   #5
s4sarath
LQ Newbie
 
Registered: May 2010
Posts: 22

Original Poster
Rep: Reputation: 0
Guys ,

I tried gparted. But no use. I couldnt extend my root space. So, I ake an unallocated space of 7gb.
Now , I want to add it to root. I can use live usb.
Specify how to add unalloctaed space to root.
 
Old 10-14-2013, 03:47 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The space can only be used if it is contiguous - or can be made so. Run this and post the complete output
Code:
sudo parted /dev/sda "print free"
(adjust if not /dev/sda).
 
Old 10-14-2013, 10:32 AM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
If you have 7Gb free space you can easily, if not very quickly, get it to be contiguous.

I assume you have a / and a /home partition or you wouldn't be referring to the problem partition as /. If that assumption is wrong and you are indeed installed on one partition your problem is very different.

If you are installed on one partition, back up your data in some manner (DVD(s), usb stick(s) or external drive) and reinstall on / and /home using all unused space on your drive. Make / at least 10GB.

When posting a question it is good to have information on your hardware and what else is install on it. From what information you give this could be the only install or the 22nd install on anything from a rooted smart phone to a super computer. Kind of hard to give advice on that sort of information. Just something to keep in mind for the future so people don't have to waste their time and yours by asking for information.
 
Old 10-15-2013, 12:04 AM   #8
s4sarath
LQ Newbie
 
Registered: May 2010
Posts: 22

Original Poster
Rep: Reputation: 0
Sure . I will update the hardware and fstab details now itself. I am having a lot of doubts now.
I will clear it now.

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2c33c43c

Device Boot Start End Blocks Id System
/dev/sda1 2048 31713279 15855616 27 Hidden NTFS WinRE
/dev/sda2 * 31713280 32430079 358400 7 HPFS/NTFS/exFAT
/dev/sda3 32430080 205310699 86440310 7 HPFS/NTFS/exFAT
/dev/sda4 205310761 625141759 209915499+ f W95 Ext'd (LBA)
/dev/sda5 205310763 399685631 97187434+ 7 HPFS/NTFS/exFAT
/dev/sda6 415216053 604657344 94720646 7 HPFS/NTFS/exFAT
/dev/sda7 620455936 625141759 2342912 82 Linux swap / Solaris
/dev/sda8 604657664 620443647 7892992 83 Linux
/dev/sda9 399687680 415215615 7763968 83 Linux

Partition table entries are not in disk order


Now , I have reinstalled by allocating 7gb to home.

My Question is ,in future If i want to expand root , how could i do that by taking space from other ntfs partitions.
I reckon , resize2fs comands have some sequence of steps.
 
Old 10-15-2013, 04:14 AM   #9
s4sarath
LQ Newbie
 
Registered: May 2010
Posts: 22

Original Poster
Rep: Reputation: 0
sudo parted /dev/sda "print free" results are as follows

sudo parted /dev/sda "print free"
Model: ATA Hitachi HTS54323 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 16.2GB 16.2GB primary ntfs diag
2 16.2GB 16.6GB 367MB primary ntfs boot
3 16.6GB 105GB 88.5GB primary ntfs
105GB 105GB 31.2kB Free Space
4 105GB 320GB 215GB extended lba
5 105GB 205GB 99.5GB logical ntfs
9 205GB 213GB 7950MB logical ext4
213GB 213GB 191kB Free Space
6 213GB 310GB 97.0GB logical ntfs
8 310GB 318GB 8082MB logical ext4
318GB 318GB 1391kB Free Space
7 318GB 320GB 2399MB logical linux-swap(v1)
320GB 320GB 352kB Free Space
 
Old 10-15-2013, 12:05 PM   #10
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Wow. I thought I was good at goofy partition tables. Going to have to take some lessons from you I think.

Inside your Extended partition why are there 2 ntfs partitions? How much unused space is in each of them? What is their function?

How much unused space is in your sda1 partition (16.GB ntfs diagnostic)? I suspect you probably have less then 10% of that used. Is it really the first partition on the drive?

How much unused space is on sda3 (88.5GB ntfs which should be your WinJerryLewis Pro install)?
 
Old 10-16-2013, 07:34 AM   #11
s4sarath
LQ Newbie
 
Registered: May 2010
Posts: 22

Original Poster
Rep: Reputation: 0
/dev/sda1 is Sony Recovery partition of 15 gb (Usually hidden in windows for safety )
/dev/sda2 is i dont know.
/dev/sda3 is C drive for my Windows
/dev/sda4 is I dont know
/dev/sda5 is E for musics
/dev/sda5 is F for study

All other ext4 is my root and my swap.

Dude to be frank I want to know ore about these things . Partitions harddisks , but dont know where to start from.
 
Old 10-16-2013, 02:25 PM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Anything you do to the partitions will need done by gparted. I know people say it is not safe but that is bull. What you can't do is mess with your sda2 partition that needs to be set correctly in realation to the blocks on your drive. This can be done with gparted but I haven't a clue, don't use Windows so don't really study any thing to do with it.

Sda1, if installed sensibly would be your boot partition which is sda2.

Sda4 is your extended partition. In the MSDos partition table you are only allowed 4 primary partitions. This would mean that you could only have 4 partitions. This was fine when that partition table was developed in the early 90s and drives were very small. When BIG drives, like 10GB, were coming on there was a neat hack come up with that allows for more partitions. You could make an extended partition. This is a modified Primary partition. You create Logical partitions within the Extended partition.

This means that all your partitions sda5 and up are Logical partitions within sda4. Logical partitions always start with 5 and go up. I mention this because most of my drives have one Extended partition which is sda1 which includes the entire drive. All other partitions are Logical and start with sda5 so I have no sda2. 3 or 4. This gives me maximum flexibility in creating partitions.

Your sda1 partition and all others are perfectly "seen" under any Unix like OS like Linux. This doesn't matter but if you check it from gparted (easy graphical presentation of your drive) you will see a lot of unused space there and that could be resized by at least 50% if it was placed anywhere else on your drive without effecting your boot partition.

Sda3 is also probably bigger than it needs to be.

If I were you I would remove your Ubuntu install, backing up any data on it first. I would then, if you have enough unused space, resize, with gparted your sda3 drive to be smaller.

Then enlarge the sda4 partition to take up that space.

Move your sda5 and sda6 drives to one end of sda4 resizing them if needed.

This will give you a solid block of unused space in sda4 to put your Ubuntu install in.

If you are keeping your data in the ntfs partitions you really don't need much of a /home partition. 3 gigs would be plenty if you have no music or pictures or video saved there. All you really need it for is your ~/.foo files (hidden files - Ctrl + h will reveal them). They are important files as they are your user configuration of your system. They don't take up a lot of space though. They are text files except for your thumbnail cache.

If what ever you are doing is mainly in the system files of Ubuntu then you could make the entire rest of the unused space in sda4 for your ubuntu / partition.

Another thing to consider is an external drive for your data storage like your sda5 and 6 ntfs partitions. If you got such a drive you could use gparted to copy/paste those partitions to the external.

You would then have room for a comfortable Ubuntu install and an ext4 data partition. This is more secure on a box with Windows on it as anyone getting into your Windows would not be able to access the ext4 partition but you can drop any files from it to an ntfs partition if Windows really needs that file.

Ubuntu should have a damned good password on it. Anyone with access to it has complete access to any file, system or data, on your Windows install and with root permissions can do anything to them at all.
 
  


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
Resizing partition in VHD file - root partition first, swap second (*Advanced*) dpesios Linux - Virtualization and Cloud 2 05-18-2012 05:50 AM
Resizing partition in VHD file - root partition first, swap second (*Advanced*) dpesios Linux - Virtualization and Cloud 3 05-17-2012 11:53 AM
URGENT! Resizing NTFS partition size problems. rconan Linux - Software 3 09-03-2005 12:03 PM
Resizing root partition?! black hole sun Mandriva 6 07-16-2004 12:00 AM
Resizing root partition bitpicker Linux - Newbie 10 09-12-2003 07:26 AM

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

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