LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2013, 01:21 PM   #1
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Rep: Reputation: Disabled
Partitions


hi everyone

i m using ubuntu for a while now and at first i give it 30 gb space and now i wanna increase it. and i went to my windows and stole 15 gb(). Made some researches about how can i add this space to my linux partition and found totally nothing.

pls help me!
-------------------------------------------------
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda2 8:2 0 99.9G 0 part
├─sda3 8:3 0 307.2G 0 part
├─sda4 8:4 0 1K 0 part
├─sda5 8:5 0 3.9G 0 part [SWAP]
└─sda6 8:6 0 39.1G 0 part /
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 30M 0 rom /media/ceset/Avea Modem
-------------------------------------------------

it is sda4 i want to add and dont know how pls help
 
Old 07-26-2013, 01:23 PM   #2
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 209717247 104755200 7 HPFS/NTFS/exFAT
/dev/sda3 209717248 853999369 322141061 7 HPFS/NTFS/exFAT
/dev/sda4 886767614 976771071 45001729 f W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5 968689664 976771071 4040704 82 Linux swap / Solaris
/dev/sda6 886767616 968689663 40961024 83 Linux

and this would help i guess
 
Old 07-26-2013, 05:29 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
You didn't post the complet fdisk output which would have shown the total size of the hard drive.
sda4 is an Extended partition which doesn't hold any data and sda5 is swap so the partition you would want to increase is sda6. If sda6 is full will can decrease the swap on sda5 or you may have to resize (shrink) sda3 in order to increase the Extended (sda4) partition and then sda6. Post the output of: df -h
 
Old 07-26-2013, 07:25 PM   #4
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
root@CesetPC:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 39G 32G 4.8G 87% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 762M 916K 761M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 1.9G 156K 1.9G 1% /run/shm
none 100M 56K 100M 1% /run/user
/dev/sr1 30M 30M 0 100% /media/ceset/Avea Modem

here it is
 
Old 07-26-2013, 09:11 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
That didn't help much as your windows partitions don't show, not mounted I would guess. You can either create mount points for sda1, sda2 and sda3 which are windows partitions (correct) and then mount them. Rerun the df -h command. You could also run: parted /dev/sda print all
which would show all partitions, mounted or not. You may not have parted installed, don't know.

When you run fdisk, you usually get drive info such as the example below, which would show above what you posted:

Quote:
[root@localhost ~]# fdisk -l

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: 0x1549f232
The example above shows a 320GB drive.
 
Old 07-26-2013, 10:03 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Quote:
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda2 8:2 0 99.9G 0 part
├─sda3 8:3 0 307.2G 0 part
├─sda4 8:4 0 1K 0 part
├─sda5 8:5 0 3.9G 0 part [SWAP]
└─sda6 8:6 0 39.1G 0 part /
Looks like it adds up to me less 15GB ...

Last edited by michaelk; 07-26-2013 at 10:04 PM.
 
Old 07-29-2013, 01:48 AM   #7
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
root@CesetPC:~# parted /dev/sda print all
Model: ATA WDC WD5000BPVT-2 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 107GB 107GB primary ntfs
3 107GB 437GB 330GB primary ntfs
4 454GB 500GB 46.1GB extended lba
6 454GB 496GB 41.9GB logical ext4
5 496GB 500GB 4138MB logical linux-swap(v1)


Warning: Unable to open /dev/sr1 read-write (Read-only file system).
/dev/sr1 has been opened read-only.
Warning: The driver descriptor says the physical block size is 512 bytes,
but Linux says it is 2048 bytes.
Ignore/Cancel? c

root@CesetPC:~#

----------------------------------------------------------------------------

guys as u already can see there is a missing part between 437 and 454 which i think the part i took from (D:\)/dev/sda3 and linux cant see this part. if i just do the whole process from linux will windows get damaged(especially not windows the files i have in d:\). i dont want it to get damaged. but windows can see that part and it says "unallocated space" might that be the problem? what should i do? reinstall ubuntu maybe. dont know pls help.
 
Old 07-29-2013, 08:54 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
You can do the process from linux but there is always a chance that something wrong might happen so always backup anything that you do not want to lose. You should also use a parted live CD since you do not want to modify the root partition with it is use.

The steps required are to move the extended partition to the end of sda3, enlarge sda4 (extended partition) to the end of the drive to encompass the unallocated space, enlarge sda6 partition to include the rest of the extended partion and enlarge the / file system.
 
Old 07-29-2013, 07:14 PM   #9
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
okay. i have done a few changes. first i went to my win os. take that unallocated space back to /dev/sda3 and started ubuntu. now :

------------------------------------------------------------------------

root@CesetPC:~# parted /dev/sda print all
Model: ATA WDC WD5000BPVT-2 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 107GB 107GB primary ntfs
3 107GB 454GB 347GB primary ntfs
4 454GB 500GB 46.1GB extended lba
6 454GB 496GB 41.9GB logical ext4
5 496GB 500GB 4138MB logical linux-swap(v1)


Warning: Unable to open /dev/sr1 read-write (Read-only file system). /dev/sr1
has been opened read-only.
Warning: The driver descriptor says the physical block size is 512 bytes, but
Linux says it is 2048 bytes.
Ignore/Cancel? c

root@CesetPC:~#

------------------------------------------------------------------------
the part between 437 and 454 which was missing stands there. now my question changed. i made searches about how to resize a partition but everyone suggests that i should use Gparted but is there any other way to do it if possible. (guess asking too much )

Last edited by ceset; 07-29-2013 at 07:27 PM.
 
Old 07-29-2013, 08:14 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Why did you add the free space back?

What is your reluctance to using gparted?

gparted is a GUI application and the best choice for what you want to accomplish.

http://gparted.sourceforge.net/livecd.php
 
Old 07-29-2013, 09:19 PM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
If you are paranoid about using GParted you should be able to use windows software. If you have vista or windows 7, you can resize by booting vista or windows 7, going to the Control Panel, Selecting Administrative Tools, Computer Management, Storage, Disk Management, More Actions on the far right then click the arrow to get All Tasks Shrink Volume and select the volume here. I imagine this would work with windows 8, but since you never indicated which windows you are using??
 
Old 07-30-2013, 01:20 PM   #12
ceset
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
If you are paranoid about using GParted you should be able to use windows software. If you have vista or windows 7, you can resize by booting vista or windows 7, going to the Control Panel, Selecting Administrative Tools, Computer Management, Storage, Disk Management, More Actions on the far right then click the arrow to get All Tasks Shrink Volume and select the volume here. I imagine this would work with windows 8, but since you never indicated which windows you are using??

u r wrong. this is not the issue here. like i said in my first message linux has a problem with seeing the unallocated space so ithought maybe i should use linux programs to add more space from win to ubuntu. i m using win7 and i know how to do it from windows. like i said the prob here is linux cant see unallocated space like i mentioned. so i decided to dot it from linux. i want to know is it best way to resize partitons Gparted no reluctance

thx for your help i will use gparted

Last edited by ceset; 07-30-2013 at 01:21 PM.
 
Old 07-30-2013, 02:49 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
I would disagree that linux has a problem. Unallocated space is not associated with a partition nor filesystem so there isn't anything to see. GUI tools including gparted will show the representation of unallocated space.
 
Old 07-30-2013, 06:21 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Wrong about what? The method I describe is the same as at the microsoft site which explains a different way to access it.

http://technet.microsoft.com/en-us/m.../gg309169.aspx

Anyhow, I agree with michaelk as I've used GParted and other partitioning software. GParted should show you the unallocated or free space. You can use it to see if it shows the unallocated space without making any changes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
rebuild partitions/label from existing partitions - used parted on wrong drive zedmelon Linux - Software 4 07-26-2013 04:42 PM
[SOLVED] Is it safe to resize my Slackware partitions after removing my Mint 10 partitions? Robert.Thompson Slackware 19 02-18-2011 12:47 PM
Change primary partitions to logical partitions AND migrate their data? chickenlinux Linux - Hardware 10 04-04-2010 05:31 PM
windows killed my partitions! no linux partitions found on this computer. The MJ Linux - Software 10 01-05-2007 09:31 AM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac SUSE / openSUSE 1 12-20-2006 06:02 PM


All times are GMT -5. The time now is 02:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration