LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-07-2021, 07:26 AM   #31
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,540

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496

Quote:
Yancek, can I "move' partitions 'left & right's like that in gparted?
I'm not sure if you have reinstalled Ubuntu yet but if not, the answer to the above question is YES. For an extremely detailed explanation you can see the link I posted earlier to the GParted Manual if you want.

Quote:
Won't sda4 be in the way of moving sda6 to the left? Or sda3 to right?
NO. That's why I asked you to post the output of fdisk, because it shows the beginning and end sectors for each partition and from the output of that command you posted above it is clear as pointed out above that sda4 is after sda3, 5 & 6.

Quote:
Too afraid to mess w moving partitions or possibly ave to replace bootfiles/boot manager.
When you boot windows, you should see the ntfs partition you created (shown as sda5 in Linux) and by a drive letter in windows, D:\ or E:\ or similar. Simplest solution to avoid partitioning and reinstalling Ubuntu would be to copy personal data folders/files to this partition from your windows C:\ partition which will leave room there for the system files.
 
1 members found this post helpful.
Old 05-07-2021, 09:35 PM   #32
cyno77
Member
 
Registered: Mar 2021
Location: Sydney, Australia
Distribution: Ubuntu Linux
Posts: 47

Original Poster
Rep: Reputation: Disabled
Yancek, thanks.

Unfortunately I don't have ANYTHING installed programwise on Windows C:, except lenovo-tools utility & SDK. I wouldn't know where to start to find all the locations of those files And correctly name them so O/s could find them, not least that, Win Really does have almost No space & I truly believe I will have to expand C: for it to function.

The minute size of C: & system win was just the file %of space LEFT, not used, in the output of the command U mentioned in my written, copied output post. Whatever. They r bigger than what U thought is all I'm saying. No big deal.

BTW, WHAT SORT of backup is everybody suggesting I do that I would BE ABLE to use to restore PARTICULAR DIRECTORIES seperately? Or just is rsync a good backup I'd be able to restore from if I ran into trouble partitioning and lost a drive/partition or boot file needed reasserting? What backup is most facilitating?
 
Old 05-07-2021, 09:45 PM   #33
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by michaelk View Post
I've used gparted for both mbr and gpt disks. I am not sure what computersavvy is referring to. You do need to run it from a live USB version.
I have never used gparted to move or resize an extended partition. My caution was that I did not know if it was even possible since doing so with already having logical partitions located there could be disastrous, especially with the entire linux OS in the logical partitions. Thus I recommended against having a newbie try it in an abundance of caution.
 
1 members found this post helpful.
Old 05-08-2021, 03:07 AM   #34
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592
Quote:
I have never used to move or resize an extended partition. My caution was that I did not know if it was even possible since doing so with already having logical partitions located there could be disastrous, especially with the entire linux OS in the logical partitions
The extended partition can be resized with gparted from a live iso. The moving of an extened partition involves moving the logical partitions then resizing the extended partition.

In the ops setup, with gparted, delete sda5 and resize the extended partition smaller so as to make room between it and sda2, then resize sda2 to fill in the empty space.

This will result in a grub-rescue prompt which can be bypassed with the following
at the grub-rescue prompt:
Code:
set prefix=(hd0,5)/boot/grub
insmod normal
normal
This should bring up the grub menu
once booted into ubuntu open a terminal and run
Code:
sudo grub-install /dev/sda
If sda2 is resized with gparted to make bigger, will need to boot into windows and run windows chkdsk

Last edited by colorpurple21859; 05-08-2021 at 03:10 AM.
 
1 members found this post helpful.
Old 05-08-2021, 06:15 AM   #35
cyno77
Member
 
Registered: Mar 2021
Location: Sydney, Australia
Distribution: Ubuntu Linux
Posts: 47

Original Poster
Rep: Reputation: Disabled
THIS is just the kind of rigorous information that credits your forum so well. Thankyou. I think I have all the info I need now, though I doubt I could have got such a decent rundown elsewhere..I have read a lot now, booting implements , & think I have enough info. I've done my backups. This thread is solved, so thank-you.
 
Old 05-08-2021, 07:43 AM   #36
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,540

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
Quote:
Unfortunately I don't have ANYTHING installed programwise on Windows C:, except lenovo-tools utility & SDK. I wouldn't know where to start to find all the locations of those files And correctly name them so O/s could find them, not least that
Appears to be a lack of communication. I suggested that if you wanted to avoid the partitioning, since you already have large, existing windows (ntfs) partition (sda5), you could simply copy 'personal' data to that partition. Personal data being document files you created, things like pictures, videos and text files you created. There would be no need to copy any system files. A default install of windows 7 should be less than 20GB and the information posted shows that partition (sda2) has over 55GB of data and system files so you either have a lot of personal data or have installed a number of programs. Using the already existing sda5 partition was just a suggestion, another option which would have avoided partitioning but you should have enough information now to do the partitioning.

Good luck.
 
1 members found this post helpful.
Old 05-08-2021, 02:58 PM   #37
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 336

Rep: Reputation: Disabled
Quote:
Originally Posted by cyno77 View Post
BTW, WHAT SORT of backup is everybody suggesting I do that I would BE ABLE to use to restore PARTICULAR DIRECTORIES seperately? Or just is rsync a good backup I'd be able to restore from if I ran into trouble partitioning and lost a drive/partition or boot file needed reasserting? What backup is most facilitating?
If I had directories(folders) like /cyno77/lives/on/pinchgut and wanted to make a backup of everything on them I'd use something like the following
Code:
rsync -vr --update /cryno77/ /run/media/cyrno/?
Which would if needs be create any needed folders and missing or changed files.

The ? is probably, unless it has been labeled something else, the alphanumeric address of the external drive (my constantly used external drive is called olga).

Now if I wanted to restore everything in the /on folder I'd use the copy (cp) command, with the command.

Code:
 cp -vr /run/media/cryno77/?/cryno77/lines/on/ /cryno77/lives/on
which would copy everything in the /on folder, including sub folders of /on, back to /cryno77/lives/on folder.

Read about the switches I'd used/have suggested in the cp man page.

Incase you missed the joke, pinchgut is about a mile ENE of Bennelong point, and would be an great residential address in Sydney,,,,,,, providing you can swim!
 
1 members found this post helpful.
Old 05-12-2021, 03:21 AM   #38
cyno77
Member
 
Registered: Mar 2021
Location: Sydney, Australia
Distribution: Ubuntu Linux
Posts: 47

Original Poster
Rep: Reputation: Disabled
Well colourpurple, I resized all specified partitions, using Mib in Gparted. When rebooted, I got to Grub rescue and it just ignored all my efforts to select correct root partition as you specified, and came back with standard grub rescue prompt. It validated nor error responsed nothing. With no response I went into Ubuntu Live Usb, as Gparted said, and tried to mount correct partitions, (couldn't even get Grub prompt up in live usb) and it said,"/mnt/proc" & "/mnt/etc/fstab" doesn't exist. After creating them.

So, (now) my fdisk -l is:

root@ubuntu:~# fdisk -l
Disk /dev/loop0: 1.99 GiB, 2109763584 bytes, 4120632 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 /dev/loop1: 55.48 MiB, 58159104 bytes, 113592 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 /dev/loop2: 218.102 MiB, 229629952 bytes, 448496 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 /dev/loop3: 31.9 MiB, 32595968 bytes, 63664 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 /dev/loop4: 51.4 MiB, 53522432 bytes, 104536 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 /dev/loop5: 64.79 MiB, 67915776 bytes, 132648 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 /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: HGST HTS725050A7
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x1f355925

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3074047 3072000 1.5G 7 HPFS/NTFS/exFAT
/dev/sda2 3074048 270178303 267104256 127.4G 7 HPFS/NTFS/exFAT
/dev/sda3 287834112 946825215 658991104 314.2G f W95 Ext'd (LBA)
/dev/sda4 946825216 976771071 29945856 14.3G 7 HPFS/NTFS/exFAT
/dev/sda5 537227264 946825215 409597952 195.3G 83 Linux

Partition table entries are not in disk order.



ls /mnt says:

ls /mnt
autofs i2c-7 random tty16 tty45 ttyS15 vcs1
block i2c-8 rfkill tty17 tty46 ttyS16 vcs2
bsg i2c-9 rtc tty18 tty47 ttyS17 vcs3
btrfs-control initctl rtc0 tty19 tty48 ttyS18 vcs4
bus input sda tty2 tty49 ttyS19 vcs5
char kmsg sda1 tty20 tty5 ttyS2 vcs6
console lightnvm sda2 tty21 tty50 ttyS20 vcsa
core log sda3 tty22 tty51 ttyS21 vcsa1
cpu loop0 sda4 tty23 tty52 ttyS22 vcsa2
cpu_dma_latency loop1 sda5 tty24 tty53 ttyS23 vcsa3
cuse loop2 sdb tty25 tty54 ttyS24 vcsa4
disk loop3 sdb1 tty26 tty55 ttyS25 vcsa5
dma_heap loop4 sdb2 tty27 tty56 ttyS26 vcsa6
dri loop5 sdb3 tty28 tty57 ttyS27 vcsu
drm_dp_aux0 loop6 sg0 tty29 tty58 ttyS28 vcsu1
drm_dp_aux1 loop7 sg1 tty3 tty59 ttyS29 vcsu2
drm_dp_aux2 loop-control shm tty30 tty6 ttyS3 vcsu3
ecryptfs mapper snapshot tty31 tty60 ttyS30 vcsu4
fb0 mcelog snd tty32 tty61 ttyS31 vcsu5
fd media0 stderr tty33 tty62 ttyS4 vcsu6
full mei0 stdin tty34 tty63 ttyS5 vfio
fuse mem stdout tty35 tty7 ttyS6 vga_arbiter
hpet mqueue tpm0 tty36 tty8 ttyS7 vhci
hugepages net tty tty37 tty9 ttyS8 vhost-net
hwrng null tty0 tty38 ttyprintk ttyS9 vhost-vsock
i2c-0 nvram tty1 tty39 ttyS0 udmabuf video0
i2c-1 port tty10 tty4 ttyS1 uhid video1
i2c-2 ppp tty11 tty40 ttyS10 uinput zero
i2c-3 psaux tty12 tty41 ttyS11 urandom zfs
i2c-4 ptmx tty13 tty42 ttyS12 userio
i2c-5 ptp0 tty14 tty43 ttyS13 v4l
i2c-6 pts tty15 tty44 ttyS14 vcs
root@ubuntu:~#
,
BTW after deleting old sda5 (sda6 moved to it I assume, though I can see no * in sda5 in fdisk), I moved sda3 to right while shrinking, and I am afraid this being the container for sda5new I may have deleted some of it? I then attempted to move Windows sda2 larger to right by 80 GB.

Any thoughts?
 
Old 05-12-2021, 03:27 AM   #39
cyno77
Member
 
Registered: Mar 2021
Location: Sydney, Australia
Distribution: Ubuntu Linux
Posts: 47

Original Poster
Rep: Reputation: Disabled
PS: My linux Disks shows this screenshot
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2021-05-12 08-24-52.png
Views:	21
Size:	85.6 KB
ID:	36369  
 
Old 05-12-2021, 08:47 AM   #40
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,540

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
Quote:
I resized all specified partitions
Sorry but your Disks and fdisk output do not show that. All they show is that you deleted the sda5 ntfs partition. You need to move the beginning of the Extended partition (sda3) to the beginning of sda6 and leave 1-2 MB after sda3 and before the current sda6. After you Apply that change, move sda2 to the right, to the beginning of sda3. Do this with either GParted on a CD/DVD/USB or from your Ubuntu install USB which contains GParted.

Look at your fdisk output for sda3, the Extended partitiion. It begins at sector: /dev/sda3 287834112 while the Ubuntu partition (shown as sda5) begins at sector: /dev/sda5 537227264. That's a lot of unallocated space in the Extended partition before Ubuntu.
Your Extended partition shows as 314.2GB in fdisk and sda5 shows as 195.3GB so that leaves about 119GB of free/unallocated space.


Quote:
I can see no * in sda5 in fdisk
I've no idea what you mean by that unless you mean the * which shows on sda1. That isn't necessary in Linux but is required for the windows boot partition so not a problem.

Quote:
I moved sda3 to right while shrinking, and I am afraid this being the container for sda5new I may have deleted some of it? I then attempted to move Windows sda2 larger to right by 80 GB.
Well, that didn't work as both your fdisk and Disks output shows although you did delete the old sda5, the windows partition. Are you sure you clicked Apply in GParted after making the changes? Try it again is all I can suggest.

Quote:
When rebooted, I got to Grub rescue and it just ignored all my efforts to select correct root partition
After resizing with GParted and trying to boot, if you have problems with the method suggested above by colorpurple21859 post specifics on exactly what happens.
 
1 members found this post helpful.
Old 05-12-2021, 08:55 AM   #41
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Ubuntu does have a boot repair you can run from the live CD.

https://help.ubuntu.com/community/Re...tallingWindows
 
1 members found this post helpful.
Old 05-12-2021, 03:19 PM   #42
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592
I left out part of the rescue prompt reboot, sorry about that.

Code:
set prefix=(hd0,5)/boot/grub
insmod normal
normal
press c for grub prompt

Code:
linux (hd0,5)/vmlinuz root=/dev/sda5
initrd (hd0,5)/initrd.img
boot
hd0 may become hd1 if you have a live usb plugged in while booting.

Last edited by colorpurple21859; 05-12-2021 at 03:27 PM.
 
1 members found this post helpful.
Old 05-12-2021, 04:09 PM   #43
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 336

Rep: Reputation: Disabled
Quote:
Originally Posted by cyno77 View Post
With no response I went into Ubuntu Live Usb, as Gparted said, and tried to mount correct partitions, (couldn't even get Grub prompt up in live usb) and it said,"/mnt/proc" & "/mnt/etc/fstab" doesn't exist. After creating them.
cryno77, In your post #39 the image doesn't mention Gparted which my electronic marvel just did when I just opened it, so I am a touch confused as to how you got that image. However....

That image also shows that immediately besides, to the left of, the coloured section the is 128GB free space and to the left of that is another 9GB free space.

Nor does the image say what way the free spaces partitions are formatted (as it does for the rest of the image). Nor is there any indication of what format the coloured section is formatted.

Edit. I've just noticed that partition 5 (which appears to be part of partition 3) is formatted ext4. Sorry, I should pay closer attention.

Which suggests to me that the fstab and proc have been installed to unformatted partitions.

To check whether they exist type,

Code:
 ls /mnt/pr*   
ls /mnt/etc/fs*
I'd be surprised if the output of either command finds either file.

Anyhow I'd go back into Gparted, remove/delete the free spaces and shrink your partition 3 (root?) to about 70+ GB, (currently 330+GB) and give partition 4 (which I'd call home or any name) the space not otherwise used. Imo 15GB is too small for a home partition.

When you've done that there should be a green tick along the top of Gparted. Clicking the tick will apply the changes ..... including formatting your changes. Which you've told the electronic marvel you want formatted to whatever.

After Gparted has finished, check that each partition indicates it is formatted the way you want them. When they are the you want them exit Gparted and do your install.

After a cut and colour today, I'll find out what covid restrictions for travel between our parts of the country are. Maybe I'll be in your part of the world on Sunday and Monday ...... I'll let you know.

Last edited by quickbreakfast; 05-12-2021 at 04:14 PM.
 
1 members found this post helpful.
Old 05-12-2021, 06:17 PM   #44
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,540

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
Quote:
Anyhow I'd go back into Gparted, remove/delete the free spaces and shrink your partition 3 (root?) to about 70+ GB, (currently 330+GB) and give partition 4 (which I'd call home or any name) the space not otherwise used. Imo 15GB is too small for a home partition.
You can't delete free/unallocated space. That won't help. Partition 3 is the Extended partition and the Ubuntu partition (sda5) is in the Extended partition. sda4 is likely the windows recovery partition so I would not suggest deleting it. The OP needs to move sda3 to the right then move sda2 to the right.
 
Old 05-12-2021, 06:40 PM   #45
cyno77
Member
 
Registered: Mar 2021
Location: Sydney, Australia
Distribution: Ubuntu Linux
Posts: 47

Original Poster
Rep: Reputation: Disabled
Thank-you Yancek, michaelk,colourpurple21859,& quickbreakfast, this is all very compelling...

Well output of ls /mnt/pr* was:

root@ubuntu:~# ls /mnt/pr*
ls: cannot access '/mnt/pr*': No such file or directory

Same for: # ls /mnt/etc/fs*

So they've both disappeared. I'm assuming the UUID and drive/volume names are all able to be accessed by everything(?)

--Thanks Yancek moving sda3 & sda 2 to right is logical.

I don't care if I don't have a 'working OS', I bought this 2016 Lenovo laptop to learn on, and that is all. Don't really care if I lose OS, just wanted to learn how they boot, etc. Fortunately!
 
  


Reply

Tags
dual boot, extend, partitionioning, partitionsize, windows 7



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
How do I increase my "/" partition space using unallocated space?(bodhi linux) PrathamBhatter Linux - Newbie 3 07-29-2020 05:56 PM
moving unallocated disk space into reiserfs partition. GUIPenguin Linux - General 3 04-08-2006 03:07 PM
Does the firewall apply also for the serial MGT? xpucto Solaris / OpenSolaris 1 01-28-2006 09:19 AM
add unallocated free space to existing disk drives!! ajaymyeg Linux - Networking 1 07-21-2004 08:17 PM
DPMS power mgt not working synaptical Linux - General 1 08-11-2003 10:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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