0

I am using Ubuntu 22.04 with two hard drives as follows:

  1. /dev/sda :

    enter image description here

  2. /dev/sdb :

    enter image description here

How can I use the free space on the second drive, /dev/sdb, for Ubuntu?

karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

0

Terse answer; for preparation and occasional use:

  1. lsblk -ape7 will tell about present hardware partitions.
    The TYPE column says part for partitions.
  2. Format the selected partition with a filesystem that suits your needs.
  3. mount the partition, e.g. udisksctl mount --block-device /dev/$device$part
  4. cd <mountpoint> # /media/$USER/<disk_label> for the above
  5. sudo chown $USER:$USER . # likely required to allow access
  6. udisksctl unmount --block-device /dev/$device$part # when done using

Note that 2. and 5. is required only once.
On boot / permanent mount not covered by this, look for /etc/fstab info.

mount/unmount can also be done from Nautilus (gnome Files) as well as from the command line, udisksctl uses the same "interface".

Note that a partition which is used from more than one OS has to be properly and fully flushed and unmounted before the next OS can use it. i.e. a hibernated or 'fastboot'-enabled Windows may cause trouble.

Hannu
  • 6,605
  • 1
  • 28
  • 45