Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Format Hard Disk to New Filesystem [Solved]

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
User avatar
larry77
Posts: 582
Joined: 2006-09-24 17:59
Has thanked: 6 times
Been thanked: 1 time

Format Hard Disk to New Filesystem [Solved]

#1 Post by larry77 »

Dear All,
I need a word of wisdom before I make my life complicated.
This is the situation on a workstation I own

Code: Select all

$ df -T 
Filesystem     Type      1K-blocks       Used  Available Use% Mounted on
udev           devtmpfs   16380328          0   16380328   0% /dev
tmpfs          tmpfs       3281684       9736    3271948   1% /run
/dev/sdc1      xfs        68324768   23748600   44576168  35% /
tmpfs          tmpfs      16408420     485280   15923140   3% /dev/shm
tmpfs          tmpfs          5120          4       5116   1% /run/lock
tmpfs          tmpfs      16408420          0   16408420   0% /sys/fs/cgroup
/dev/sdc3      xfs      2831227196 1126631988 1704595208  40% /home
/dev/sdb1      xfs      2928834296  508384704 2420449592  18% /home/lorenzo/toshiba2
/dev/sda1      ext4     2884152536  196890092 2540732808   8% /home/lorenzo/extra
I have 3 hard drives and two of them are xfs and one (for historical reasons) is ext4. Without going into any war about which filesystem is better, suppose that I want to change the sda1 hard disk from ext4--->to xfs. I have plenty of space so I can move its present content somewhere else.
Is there any easy way to do it and remount everything back as it is?
I simply want to have xfs everywhere.
Cheers

larry77
Last edited by larry77 on 2020-11-22 22:02, edited 1 time in total.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Format Hard Disk to New Filesystem

#2 Post by sgosnell »

It's easy enough to reformat a drive. You can do it from the command line or with gparted, as you choose.
Take my advice, I'm not using it.

User avatar
larry77
Posts: 582
Joined: 2006-09-24 17:59
Has thanked: 6 times
Been thanked: 1 time

Re: Format Hard Disk to New Filesystem

#3 Post by larry77 »

I did this with gparted, but now the workstation complains because it does not find the disk and starts only in emergency mode (no graphical interface).
Any idea about how to fix this?
Thanks!

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Format Hard Disk to New Filesystem

#4 Post by CwF »

fsarchiver would have been the ticket.
larry77 wrote:emergency mode
Did you change the UUID?

User avatar
larry77
Posts: 582
Joined: 2006-09-24 17:59
Has thanked: 6 times
Been thanked: 1 time

Re: Format Hard Disk to New Filesystem

#5 Post by larry77 »

CwF wrote:fsarchiver would have been the ticket.
larry77 wrote:emergency mode
Did you change the UUID?
I do not know anything about the UUID. I just used gparted naively thinking that I could not do too much damage since I did not touch the hdd with the operating system installation. It is possible that gparted changed it, but I did not do it willingly.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Format Hard Disk to New Filesystem

#6 Post by sgosnell »

You will probably need to edit /etc/fstab to use the new UUID. You can use nano or whatever command-line text editor you have installed to do that. First, get the UUID with blkid as root, copy that UUID, and paste it to the appropriate line in fstab. It should then boot. You can add nofail to the options if you want, to prevent boot failure if it's not present for some reason. If you really want to use a GUI for most of the editing, just comment the line for sda1 by inserting # as the first character in the line, boot to your desktop, and then edit fstab as root with whatever text editor you like. I find it easier to use nano, but that's just my preference.
Take my advice, I'm not using it.

User avatar
larry77
Posts: 582
Joined: 2006-09-24 17:59
Has thanked: 6 times
Been thanked: 1 time

Re: Format Hard Disk to New Filesystem

#7 Post by larry77 »

Thanks, finally due to time constraint, believe it or not, it was faster to reinstall.
I will call this experience (a good naming for your own mistakes).

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Format Hard Disk to New Filesystem

#8 Post by sgosnell »

Yes, a reinstall is usually faster, unless you have a lot of data that has to be retained. Even so, a full backup, reinstallation, and returning the data is usually faster. Each situation is a little different, though.
Take my advice, I'm not using it.

Post Reply