Moving the file system

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Moving the file system

Post by Gulltastic1974 »

A couple of month ago I changed from windows to a dual-boot with mint. This is the first time I've really used Linux (other than playing with Raspberry Pi) I've not booted into windows since!

Through my own poor planning and not really understanding how linux file system works, I've run out of space on the home folders, and I am struggling to understand the way drives work.
I have 3 hard drive in my machine. 1TB, 2TB, 2TB.
One of the 2TBs has all my personal files, music, pictures, etc from over the years.
The 1TB I had labelled "Linux". On it is only a folder called System Volume Information.
The final 2TB I split into 2 in windows, one partition for Windows and the other for Linux.

I'm now running low on space for "file system", with only 12GB remaining space!

What's my next steps here? Can I move software to the empty 1TB? can I easily get rid of the windows partition?

system info:

Code: Select all

System:
  Kernel: 5.15.0-101-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 6.0.4
    tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B250M-A v: Rev X.0x serial: <superuser required>
    UEFI: American Megatrends v: 1205 date: 05/11/2018
CPU:
  Info: dual core model: Intel Pentium G4560 bits: 64 type: MT MCP smt: enabled arch: Kaby Lake
    rev: 9 cache: L1: 128 KiB L2: 512 KiB L3: 3 MiB
  Speed (MHz): avg: 1594 high: 1600 min/max: 800/3500 cores: 1: 1600 2: 1600 3: 1585 4: 1594
    bogomips: 27999
  Flags: ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] vendor: ASUSTeK driver: nvidia v: 535.161.07 pcie:
    speed: 8 GT/s lanes: 16 ports: active: none off: HDMI-A-1,HDMI-A-2 empty: DP-1,DP-2,DVI-D-1
    bus-ID: 01:00.0 chip-ID: 10de:1c03 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1200 s-dpi: 92 s-size: 1060x335mm (41.7x13.2") s-diag: 1112mm (43.8")
  Monitor-1: HDMI-0 pos: primary,left res: 1920x1080 hz: 60 dpi: 93 size: 527x296mm (20.7x11.7")
    diag: 604mm (23.8")
  Monitor-2: HDMI-1 pos: right res: 1920x1200 hz: 60 dpi: 94 size: 518x324mm (20.4x12.8")
    diag: 611mm (24.1")
  OpenGL: renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 v: 4.6.0 NVIDIA 535.161.07
    direct render: Yes
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:a2f0 class-ID: 0403
  Device-2: NVIDIA GP106 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel
    pcie: speed: 8 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f1 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.0-101-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK PRIME B450M-A
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 4.57 TiB used: 1.73 TiB (37.8%)
  ID-1: /dev/sda model: T-FORCE 1TB size: 953.87 GiB speed: 6.0 Gb/s type: SSD serial: <filter>
    rev: 0A0 scheme: MBR
  ID-2: /dev/sdb vendor: Toshiba model: DT01ACA200 size: 1.82 TiB speed: 6.0 Gb/s type: HDD
    rpm: 7200 serial: <filter> rev: ABB0 scheme: MBR
  ID-3: /dev/sdc vendor: Seagate model: ST2000LM015-2E8174 size: 1.82 TiB speed: 6.0 Gb/s
    type: HDD rpm: 5400 serial: <filter> rev: 0001 scheme: GPT
Partition:
  ID-1: / size: 179.58 GiB used: 158.94 GiB (88.5%) fs: ext4 dev: /dev/sdc6
  ID-2: /boot/efi size: 96 MiB used: 31.1 MiB (32.4%) fs: vfat dev: /dev/sdc1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 469.4 MiB (22.9%) priority: -2 file: /swapfile
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 12 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-5:2 info: Dell Universal Receiver type: Keyboard,Mouse,HID
    driver: hid-generic,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 413c:301c
    class-ID: 0300
  Device-2: 1-6:3 info: SiGma Micro Keyboard TRACER Gamma Ivory type: Keyboard,HID
    driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 1.5 Mb/s power: 98mA chip-ID: 1c4f:0002
    class-ID: 0300
  Device-3: 1-11:4 info: Genesys Logic Logilink CR0012 type: Mass Storage driver: usb-storage
    interfaces: 1 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 05e3:0745 class-ID: 0806
    serial: <filter>
  Hub-2: 2-0:1 info: Super-speed hub ports: 6 rev: 3.0 speed: 5 Gb/s chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nvidia temp: 54 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Repos:
  Packages: 2963 apt: 2923 flatpak: 31 snap: 9
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/bablu-boy-nutty-jammy.list
    1: deb [signed-by=/etc/apt/keyrings/bablu-boy-nutty-jammy.gpg] https: //ppa.launchpadcontent.net/bablu-boy/nutty/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/elementary-os-stable-jammy.list
    1: deb [signed-by=/etc/apt/keyrings/elementary-os-stable-jammy.gpg] https: //ppa.launchpadcontent.net/elementary-os/stable/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/github-cli.list
    1: deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https: //cli.github.com/packages stable main
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https: //dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http: //packages.linuxmint.com virginia main upstream import backport
    2: deb http: //archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
    3: deb http: //archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
    4: deb http: //archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
    5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/teejee2008-foss-jammy.list
    1: deb [signed-by=/etc/apt/keyrings/teejee2008-foss-jammy.gpg] https: //ppa.launchpadcontent.net/teejee2008/foss/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/qgis.sources
    1: deb deb-src [arch=amd64] https: //qgis.org/debian-ltr jammy main
Info:
  Processes: 284 Uptime: 3h 19m wakeups: 0 Memory: 7.7 GiB used: 5.2 GiB (67.6%) Init: systemd
  v: 249 runlevel: 5 Compilers: gcc: 11.4.0 alt: 11/12 Client: Cinnamon v: 6.0.4 inxi: 3.3.13
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving the file system

Post by AndyMH »

There are a number of things you can do, but before anyone offers advice, post the output of sudo parted --list. This tells us about your drives.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Re: Moving the file system

Post by Gulltastic1974 »

Thanks! Here it is:

Code: Select all

Model: ATA T-FORCE 1TB (scsi)
Disk /dev/sda: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1024GB  1024GB  primary  ntfs


Model: ATA TOSHIBA DT01ACA2 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  2000GB  2000GB  primary  ntfs         boot


Model: ATA ST2000LM015-2E81 (scsi)
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot, esp
 2      106MB   123MB   16.8MB               Microsoft reserved partition  msftres
 3      123MB   512GB   512GB   ntfs         Basic data partition          msftdata
 4      512GB   1803GB  1291GB  ntfs         Basic data partition          msftdata
 6      1803GB  2000GB  197GB   ext4
 5      2000GB  2000GB  556MB   ntfs                                       hidden, diag
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving the file system

Post by AndyMH »

Can I move software to the empty 1TB
You have choices but that is the one thing you cannot do. With linux software gets installed into specific folders, like executables in /usr/bin. The upside that linux applications are not space hungry like win. The exception is software installed as flatpaks and you might be able to move them to another partition. I don't use them so I will leave that for others to comment on.

You could:
  • shrink sdc3 or sdc4 (your win partitions, one is C:) to create more space for sdc6, your / partition.
  • or delete win completely,
  • or move mint to sda, your empty 1TB drive.
  • or mount sda1 somewhere easy to get at, e.g. /home/you/data and move a lot of your data files in mint to it.
and there are others. I think if it was me, I would move mint to your empty 1TB drive. If you want to do this, I can tell you how. Googling, I think your 1TB drive is an SSD so you would see significant performance improvements running mint from that drive.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Re: Moving the file system

Post by Gulltastic1974 »

thanks so much for this - yes the issue is that I assumed that like windows, I'd be able to move software wherever I liked. Yes I'd appreciate a guide on how to move everything to the empty 1TB SSD drive please!
bendipa
Level 5
Level 5
Posts: 586
Joined: Sat Jan 04, 2020 8:02 pm
Location: NW London. UK

Re: Moving the file system

Post by bendipa »

Looks like you have Linux and Windows on disk sdc, and that disk sdb is completely wasted in space as you have dedicated 2TB of it to an MBR boot partition that isn't even used. At this stage, I am presuming that it's sdc1 that boots both Windows and Linux. But unless that's checked I can't be certain. It's easy to confirm this.

Assuming that to be the case, I would move Mint's sdc6 partition to disk sdb. You'll need to run a few commands to configure this correctly, but it's not that difficult. But before that I would first convert disk sdb to GPT from its MBR status. That can be done from gparted, or by a terminal command.
Computer: Dell Vostro 470
Systems: Linux Mint 21.3 Xfce (Una), Manjaro 23.1 Xfce (Vulcan), Windows 10 (22H2) Pro.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving the file system

Post by AndyMH »

BEFORE you start, you will need a mint install stick and backup anything you consider important - just in case! It would also be a good idea to disconnect sdb, your 2TB drive with all your personal files, music, pictures - won't be going near it but another just in case. Note that device names like sdb are not fixed in linux, so disconnecting sdb might mean that sdc, your current win/mint drive changes, e.g. to sdb.

Boot your mint install stick and run gparted. If you haven't used it before it is the standard linux partition editor. It looks like this:
Screenshot from 2024-03-25 18-18-37.png
This is my system drive. The drive selector is a drop down top right and you get the panel on the left with view > device information - this can help to make sure you select the correct drive.

Select your 1TB drive "T-FORCE 1TB", currently sda, and put a new partition table on it. This is Device > Create Partition Table. You want a GPT partition table as you are booting UEFI. This will wipe the drive, so make sure you select the right drive.

Right click in the unallocated space and new. Create a new partition, size 100MiB* and format fat32 , this will be you new EFI partition, but initially unused. When you create a partition with gparted it will tell you what will happen at the bottom of the window, nothing happens until you edit > apply all changes. Having created the partition, right click on it and manage flags - set the flags esp & boot. This is what tells the system that bootloaders live here.

Now select your existing win/mint drive, currently sdc, right click on sdc6 your mint / partition and select copy. Go to 1TB drive "T-FORCE 1TB", currently sda, right click in the unallocated space and paste. It may take some time, you have around 190GB to copy!

When finished, select your win/mint drive again, right click on sdc6 your old mint / partition and select New UUID, assign a random UUID to the partition. Why? When you boot, grub looks for your / partition by its UUID, you have two identical / partitions with the same UUIDs, this will confuse it. So we change the UUID on the old / partition so it will find your new / partition on the 1TB drive.

Now reboot, does it find mint and boot up? It should and it should be a bit quicker booting from an SSD.

Assuming it boots okay. Boot your mint install stick, run gparted again and resize your / partition on the SSD, probably sda2 to use all the unallocated space.

That's enough for now, assuming everything works, tomorrow I'll tell you how to move grub, the bootloader, into the EFI partition you created on your 1TB drive. At the moment you are booting grub from your 2TB win drive. You can also delete your old / partition, but leave that until everything is working with the new setup.


* gparted shows size in MiB/GiB, etc. = powers of 2, everything else uses MB/GB = powers of 10.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Re: Moving the file system

Post by Gulltastic1974 »

Thanks again for this, I'm away working at the moment but will give it a try by the weekend and let you know how I get on. I really appreciate you taking the time to explain all this!
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Re: Moving the file system

Post by Gulltastic1974 »

Sorry this took a while, but I followed your instructions and it seems to be going well! I am ready for part 2 AndyMH!
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving the file system

Post by AndyMH »

I'm assuming your existing win/mint drive is sdc and your new mint only drive is sda.

This is about moving grub from sdc to sda. If the device names have changed, change below as appropriate.

Boot mint and confirm things are where they are expected, open a terminal and df.
  • sdc1 (your EFI partition on sdc) should be mounted at /boot/efi. You haven't moved it yet.
  • sda2 should be mounted at /. What you did last time.
Confirm you have an EFI partition on sda with the correct flags (what you created last time), in a terminal sudo parted --list. I've used quotes so I can highlight what you are looking for - size 105MB, format fat32 and the flags esp and boot (you will also see same on sdc1):
andy@M720 ~ $ sudo parted --list
[sudo] password for andy:
Model: CT2000P3SSD8 (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 106MB 105MB fat32 boot, esp
2 106MB 21.1GB 21.0GB ext4

You need to move the boot files from sdc1 to your new EFI partition sda1.

Open nemo, the file manager, click File System in left pane and then double click on /boot to open it. Double click on the efi folder, it will ask for your password twice and you will get this (I've expanded the EFI folder so you can see the content):
Screenshot from 2024-04-07 22-31-31.png
Yours will be the same except you will also have a WINDOWS folder alongside BOOT and ubuntu.

Now open disks, in the left pane select sda (ATA T-FORCE 1TB) and click on sda1 on the right hand side - this is the empty EFI partition you created. Click on the mount button (circled) to mount it:
Screenshot from 2024-04-07 22-35-55.png
"Contents" will change to show where it is mounted as a hyperlink, click on it to open in nemo.

Copy the EFI folder from the old EFI partition (sdc1) into the new EFI partition (sda1). When you have copied the EFI folder you can delete the WINDOWS folder inside it - make sure you delete the copy on sda1 not the one on sdc1. This will leave you with a BOOT folder and ubuntu folder.

Reboot and go into BIOS, in your boot list you should have two entries for "ubuntu". Try each one and when booted into mint check which EFI partition it is using, open a terminal and df. As above, you are looking for the partition mounted at /boot/efi.

When you have confirmed that mint can boot using the EFI partition on sda1, you can delete the ubuntu folder in your old EFI partition, sdc1. Use disks to mount it as described above.

You now have win booting from its own EFI partition on sdc and mint booting from its own EFI partition on sda.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
lsemmens
Level 11
Level 11
Posts: 3951
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Moving the file system

Post by lsemmens »

Also, be aware that "Timeshift" backup files are, by default, saved to your linux partition, which can fill up with those, fairly easily. They CAN be moved/deleted, but, as I do not use timeshift, I cannot give any more info. (P.S, Don't tell me I'm silly for not using TS, I'm happy to blow everything away and start again if I get into trouble - yes, critical files are backed up)
Fully mint Household
Out of my mind - please leave a message
Gulltastic1974
Level 1
Level 1
Posts: 9
Joined: Sun Dec 03, 2023 7:31 am

Re: Moving the file system

Post by Gulltastic1974 »

Brilliant, that's all working great. Thank you again for providing such a thorough walk through of this, it is much appreciated!
Post Reply

Return to “Installation & Boot”