18

The Ubuntu installer does not allow me to install on NTFS partitions, but certain circumstances requires me to do so. Is it possible?

Oxwivi
  • 17,849
  • Wubi? ... and If the installer allows you to install on NTFS partitions , the filesystem should be changed to ext4 ? am I right? – Binarylife Aug 02 '11 at 07:24
  • I won't be running Windows. – Oxwivi Aug 02 '11 at 07:33
  • I see, I don't think there is a way to do it. – Binarylife Aug 02 '11 at 07:38
  • Which circumstances require NTFS? You can install Ubuntu on ext* and use another partition (NTFS) for those circumstances... –  Aug 02 '11 at 07:47
  • It's on a USB, and live USB certainly is not the desired solution. I have failed to use fstab and bind NTFS folders to the ones in my Ubuntu install. – Oxwivi Aug 02 '11 at 09:15
  • Why do not format USB partition with extN? – enzotib Aug 02 '11 at 09:31
  • 1
    @enzotib, that'd be fine, but I need it accessible to Windows systems. The USB is dual purpose to serve as storage medium and a portable operating system as well. – Oxwivi Aug 02 '11 at 13:29
  • 1
    So make a first primary partition for windows storage, and another partition for installing ubuntu (plus swap, if needed) – enzotib Aug 02 '11 at 13:33
  • Yes, well, as you can read my comment in reply to Rachid, I failed. I wanted to bind a few folders to make them available both to my storage and Ubuntu folders, but for some reason it did not work out. – Oxwivi Aug 02 '11 at 14:45
  • format and install to the partition as fat32... should be accessible in linux and windows – 13east Aug 02 '11 at 15:11
  • 1
    @13east, 4 GB file size limit is not a limitation I can entertain. – Oxwivi Aug 02 '11 at 15:39
  • than you should partition the usb-drive into two drives as mentioned earlier... NTFS is not a linux supported system and read/write access to it were only achieved after working out backwards compatibility issues (ntfs-3g)... have your storage drive as the first partition and USB-live installation as second because windows will only give you access to the first accessible drive on a USB drive – 13east Aug 02 '11 at 16:13
  • If you are still wondering about this, please see this. – Kong Chun Ho May 13 '17 at 08:28
  • It seems I don’t have the reputation to answer this question, so I’m adding a comment. As of kernel 5.15 it is possible - although not recommended - to install Linux directly on NTFS. It can even use the same partition as Windows! Here’s an article about it: https://www.theregister.com/2021/11/22/install_linux_on_ntfs – Konrad Botor Mar 03 '23 at 09:45

4 Answers4

12

No. NTFS doesn't support Linux file permissions so you can't install a Linux system on it.

  • 4
    No ugly hacks either? – Oxwivi Aug 02 '11 at 07:35
  • Maybe somewhere there exists some hack that implements a Linux file system on top of NTFS like UMSDOS did on top of FAT, but I've never seen that. – Florian Diesch Aug 02 '11 at 11:48
  • Sounds promising, any hints as to where I can find more info about such stuff? – Oxwivi Aug 02 '11 at 13:30
  • 1
    It does not work in that manner. You won't be able to install Ubuntu onto an NTFS partition - the permissions systems just do not work on that type of partition. – Thomas Ward Aug 02 '11 at 15:17
  • 1
  • I don't see a letter of documentation, how do I use it? – Oxwivi Aug 02 '11 at 18:59
  • I never used it, just found it while searching the web. The tarball contains some short docs – Florian Diesch Aug 02 '11 at 19:27
  • 1
    I am not really satisfied by this answer. Isn't there a way to ignore system permissions? There is Cygwin, VirtualBox and Samba surely there is somewhat to get it to partially working. Although they certainly don't imply such would work. – William Oct 22 '15 at 16:18
  • it's actually incorrect. it's possible to store Linux permissions with ntfs-3g. In the past it was also possible to install Linux on FAT – phuclv Feb 10 '18 at 11:51
  • Now that WSL provides a standard way to store permissions on NTFS... any updates? – user541686 Dec 28 '18 at 05:14
  • @user541686 It is possible to install Linux on NTFS as of kernel 5.15: https://www.theregister.com/2021/11/22/install_linux_on_ntfs – Konrad Botor Mar 03 '23 at 09:47
  • @KonradBotor: Thanks! I remember hearing about it but then this happened and I wasn't sure if I could rely on the NTFS support. – user541686 Mar 03 '23 at 14:57
  • @user541686 As far as I can tell it's still supported: https://github.com/Paragon-Software-Group/linux-ntfs3 – Konrad Botor Mar 04 '23 at 15:41
  • @KonradBotor: Right, but the question is how long will it be there. I'm not going to install it only to find out in 2024 the feature is removed. – user541686 Mar 04 '23 at 16:15
  • @user541686 I see your point, but really what guarantee do we have that any of the current features will remain there in the future? – Konrad Botor Mar 05 '23 at 21:19
  • @KonradBotor: The fact that they've been around for years/decades with millions of users, maybe? The fact that they have maintainers who haven't dropped the ball, maybe? Is that a serious question? Do you genuinely think Linux is equally likely to drop support for NTFS as it is for ext4 next year? – user541686 Mar 05 '23 at 21:40
  • @user541686 Of course not. My point was that the support for any feature can be dropped, however small the chance is. Ext4 driver is widely used, so even if all its current maintainers quit tomorrow, someone will step up to take their place - especially considering how many commercial systems rely on it. I think there are enough people who want the NTFS support in Linux to keep it alive, not to mention the negative press for Paragon if they dropped it. – Konrad Botor Mar 13 '23 at 21:53
  • @KonradBotor: I'm saying I think it's possible there aren't enough people for that. You're welcome to disagree of course. – user541686 Mar 14 '23 at 00:00
12

It is possible to install Ubuntu on a NTFS partition.

Image Creation

You need to create an image file on your NTFS partition. Try boot up your Ubuntu Live CD, start a terminal, change directory into your NTFS partition, and create a image file:

cd /media/ubuntu/<your_ntfs_partition>/
mkdir linux
cd linux/
dd if=/dev/zero of=./linux.img bs=1M count=32768
mkfs.ext4 ./linux.img

This will create an image file of size 32GB with EXT4 at linux/linux.img

Loopback Filesystem Setup

Now, create a virtual block device at /dev/sdX where X is a non-occupied block device character (i.e. I only have /dev/sda, so I used /dev/sdb);

Also choose a minor number (in this case 200) that is not in use with ls -al /dev:

sudo mknod /dev/sdb b 7 200
sudo losetup /dev/sdb ./linux.img

Installing Ubuntu

You can now launch the Ubuntu installer and install Ubuntu on /dev/sdX, make sure you have install the bootloader to your real disk (or EFI partition) if you don't have Windows installed on that disk. After the installation, you need to get the kernel and initrd file name by mounting the image:

sudo mkdir /media/ubuntu/rfs
sudo mount -o loop /dev/sdb /media/ubuntu/rfs
ls -al /media/ubuntu/rfs/boot

Mark down the kernel and initrd filename, in my case that's vmlinuz-4.4.0-31-generic, and initrd.img-4.4.0-31-generic.

Bootloader

I have a Windows on my NTFS partition, so I have chosen Grub2Win as my bootloader. However, if you don't have Windows installed and insisted to use a NTFS partition (which is no point to do so though), GRUB should have installed on your disk in the previous step. No matter you use Grub2Win or the original GRUB, You need to edit your GRUB config and use the following:

echo Booting linux...

loopback loop0 (hd0,1)/linux/linux.img
set root=(loop0)
linux /boot/vmlinuz-4.4.0-31-generic root=/dev/sda1 loop=/linux/linux.img rw verbose nosplash
initrd /boot/initrd.img-4.4.0-31-generic

You need to edit (hd0,1) and /dev/sda1 to the NTFS partition that your linux image resides in. You may use the GRUB command line to get it. Also modify the kernel and initrd filenames according to your installation. Make sure your GRUB have NTFS and loopback support.

Now, when you boot the disk, you can boot into Ubuntu with GRUB. I have written my steps and procedure to here, but I am using Grub2Win as I mentioned earlier.

Kong Chun Ho
  • 406
  • 4
  • 12
  • 2
    please don't write an answer just to refer to another question. That can be done using comments when you have enough reputation, or by flagging as a duplicate if appropriate – Zanna May 13 '17 at 09:26
  • 1
    Sorry, I am gonna write up a full answer. This question does not duplicate with the another question, the answer of this question does, however, requires actions involved in the answer of that question. – Kong Chun Ho May 14 '17 at 12:44
  • Ok, please [edit] your answer :) – Zanna May 14 '17 at 13:13
  • Done. Could the downvoter kindly retract your downvote? Thanks. – Kong Chun Ho May 14 '17 at 13:50
  • It wasn't me... and whoever it was won't be notified. I don't understand the topic well enough to upvote your answer, hopefully others will – Zanna May 14 '17 at 14:40
  • Sure, no problem. :) – Kong Chun Ho May 14 '17 at 14:54
  • However you don't actually use NTFS but ext4: "It basically creates a RAW image file on the NTFS partition, and formatted it as EXT4." - so you are not installing ubuntu on NTFS so that it would stay NTFS when used etc. , which I think was the intent of the question. Seems that running Linux on NTFS is not supported (except by a kind of virtualization like wubi) – antont May 15 '17 at 19:42
  • @antont Well, that depends on how you see it. The RAW image file is organized with EXT4, but this image file is reside on a NTFS partition. It uses NTFS though as the setup will not work if your kernel doesn't support NTFS. – Kong Chun Ho May 16 '17 at 13:56
  • What should /etc/fstab look like in this scenario? – whoKnows May 05 '18 at 17:55
  • 1
    @whoKnows Sorry for late reply. In this case, the /etc/fstab looks like this: UUID=8616f9db-70ac-496e-a6b2-808a36332dc4 / ext4 errors=remount -ro 0 1. It looks like it is using a UUID instead of a block device. – Kong Chun Ho Jun 06 '18 at 19:12
4

I'm not sure what your "certain circumstances" are, but you are better off resizing the partition and letting Ubuntu have its own space. You can always resize/move the Ubuntu partition later.

You cannot install Linux on an NTFS system for security, technical, and other reasons (for example, NTFS is supported by a user-space driver).

RolandiXor
  • 51,541
  • 1
    Also, symbolic links are not supported by NTFS and are required. – NRoach44 Nov 01 '11 at 07:58
  • @NRoach44: you can add your own answer if you like :)... – RolandiXor Nov 01 '11 at 15:06
  • @Mehrdad that's clearly NOT recommended, and potentially dangerous. I'm deleting your comment to protect new users. Also, when replying with such comments, make sure to check the date of the answer. – RolandiXor Mar 16 '19 at 04:16
  • @RolandiXor: I did read it, but I'm saying the reasoning is incorrect, and that has nothing to do with the date. Clearly the fact that NTFS is supported by a userspace driver doesn't prevent it from being used. The fact is your reasons are bogus and don't prevent this from happening. It's a an abuse of mod privileges in my book to delete my comment when I'm pointing out your answer is incorrect, but in any case, you should update your answer first so that it doesn't lie to people... – user541686 Mar 16 '19 at 04:17
0

Supposedly, wubi is an Ubuntu installer which allows to "install and uninstall Ubuntu in the same way as any other Windows application" - I never tried this but I suppose the whole partition is contained in a file which can be on an NTFS drive.

http://www.ubuntu.com/download/ubuntu/windows-installer

I'm pretty sure it's not possible to install Ubuntu on an NTFS partition in the traditional sense of the word - i.e. as a stand-alone OS which directly accesses the drive etc. For one thing, filesystem permissions models are quite different etc.

However, you can access NTFS partitions from an Ubuntu which is installed on a, for example, ext4-partition.

Sergey
  • 43,665
  • But there's no Windows for me to install Wubi in... – Oxwivi Aug 02 '11 at 07:33
  • 2
    If you don't have windows, why do you need NTFS? Just forget it. It's like you want to install Windows on ext2/3/4, even if you don't have any Linux to support ext* filesystems :) But anyway, in theory, it's not totally impossible to install on NTFS: you can create a big enough file on the NTFS, which is used as a loopback mount (so that file will be the ext3/4 "inside"). However, I am not sure if there is simple method to do this ... Even in that case, from Linux's view point, it's installed on ext2/3, just it's only a file on NTFS then ... – LGB Aug 02 '11 at 13:01
  • Wubi only works because it creates a disk blob partitioned as a drive with EXT3 installed inside of that disk blob. Ergo blob exists on NTFS partition. But it's more of a disk inside of a disk then Ubuntu on NTFS – Marco Ceppi Aug 02 '11 at 14:56
  • @Marco, can we bind folders from a live USB's disk blob to some folder in the NTFS partition? – Oxwivi Aug 02 '11 at 15:46
  • @Oxwivi Over my head at that point. – Marco Ceppi Aug 02 '11 at 15:47
  • Wubi doesn't work with Windows 8/10 – Suici Doga Feb 14 '16 at 08:31