LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partitions (https://www.linuxquestions.org/questions/linux-newbie-8/partitions-4175471032/)

ceset 07-26-2013 12:21 PM

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(:D). 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

ceset 07-26-2013 12:23 PM

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

yancek 07-26-2013 04:29 PM

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

ceset 07-26-2013 06:25 PM

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

yancek 07-26-2013 08:11 PM

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.

michaelk 07-26-2013 09:03 PM

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 ...

ceset 07-29-2013 12:48 AM

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.

michaelk 07-29-2013 07:54 AM

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.

ceset 07-29-2013 06:14 PM

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 :D)

michaelk 07-29-2013 07:14 PM

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

yancek 07-29-2013 08:19 PM

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??

ceset 07-30-2013 12:20 PM

Quote:

Originally Posted by yancek (Post 4999268)
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

michaelk 07-30-2013 01:49 PM

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.

yancek 07-30-2013 05:21 PM

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.


All times are GMT -5. The time now is 04:03 AM.